Files
old-profesor-atom/Profesor Atom/Library/metadata/42/429a484b95998f84eaa98fa068caa5e9

229 lines
10 KiB
Plaintext
Raw Normal View History

2017-05-17 12:25:25 +03:00
w)<29>5.6.1f1<00><><EFBFBD><EFBFBD><00><><EFBFBD>0<05><><EFBFBD><EFBFBD>L.`?^<5E>0D7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00><00><00><00><00><00><00><00><00>#<00><00>+H<00>3<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00> Q<00>j<00>
<00><00>< <00><00>H H<00>Z<00><><EFBFBD><EFBFBD> <00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00><00><00>g<00><00><00><00><00><00>#<00><00>+v~<00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><><00><00><> <00><00><>!<00><00><>"<00><00><>#<00><00>$<00><00>%<00><00>&<00><00>#<00><><EFBFBD><EFBFBD>'<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(<00><00><00><00>)H<00>j<00><><EFBFBD><EFBFBD><EFBFBD>*<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>+@<00><00><00>,Q<00>j<00>-<00><00>*.<00><00>8/AssetMetaDataguiddata[0]data[1]data[2]data[3]pathNametimeCreatedoriginalChangesetoriginalNameoriginalParentHash128originalDigestbytes[0]bytes[1]bytes[2]bytes[3]bytes[4]bytes[5]bytes[6]bytes[7]bytes[8]bytes[9]bytes[10]bytes[11]bytes[12]bytes[13]bytes[14]bytes[15]labelsassetStoreReflicenseType <00><>z{<0E>@<40><05><>5^(<28>H'<00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00> <00><00> <00><00>#.<00>,<00><00><><00> <00><00>#.<00>,H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>
Q<00>j<00> <00><00>5<00><><EFBFBD><EFBFBD> <00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> <00><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>#.<00>, <00>I@<00><00>X @<00><00>#.<00>,H<00>]<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00>h<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>!Q<00>j<00>"H<00>z<00><><EFBFBD><EFBFBD>#<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$@<00><00><00>%Q<00>j<00>&MonoImporterPPtr<EditorExtension>m_FileIDm_PathIDm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants<00><><EFBFBD>8-l'<27><>愁h<E68481>ΐA,<00><00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00><00><00> <00><00>.<00><00><00><><00> <00><00>.<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>
Q<00>j<00> H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>Q<00>j<00><00><00>(<00><><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><01><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><01>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>.<00>y<00>< <00><00>.<00><00><00>CH<00>T<00><><EFBFBD><EFBFBD><10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00>!Q<00>j<00>"H<00>`<00><><EFBFBD><EFBFBD>#<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$@<00><00><00>%Q<00>j<00>&H<00>l<00><><EFBFBD><EFBFBD>'<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(@<00><00><00>)Q<00>j<00>*L<00>{+PPtr<EditorExtension>m_FileIDm_PathIDm_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespacem_AssemblyNamem_IsEditorScript<00><00>@<00>y<EFBFBD><00><00><00><>^\a<><61>M<EFBFBD>Q<EFBFBD>| <09>e.$<24><><EFBFBD>Y<EFBFBD><59>H<EFBFBD><48><EFBFBD>
<EFBFBD><EFBFBD>Z<EFBFBD>;Assets/SteamVR/InteractionSystem/Longbow/Scripts/Balloon.cs<00><>*Balloon]//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: BALLOONS!!
//
//=============================================================================
using UnityEngine;
using System.Collections;
namespace Valve.VR.InteractionSystem
{
//-------------------------------------------------------------------------
public class Balloon : MonoBehaviour
{
public enum BalloonColor { Red, OrangeRed, Orange, YellowOrange, Yellow, GreenYellow, Green, BlueGreen, Blue, VioletBlue, Violet, RedViolet, LightGray, DarkGray, Random };
private Hand hand;
public GameObject popPrefab;
public float maxVelocity = 5f;
public float lifetime = 15f;
public bool burstOnLifetimeEnd = false;
public GameObject lifetimeEndParticlePrefab;
public SoundPlayOneshot lifetimeEndSound;
private float destructTime = 0f;
private float releaseTime = 99999f;
public SoundPlayOneshot collisionSound;
private float lastSoundTime = 0f;
private float soundDelay = 0.2f;
private Rigidbody balloonRigidbody;
private bool bParticlesSpawned = false;
private static float s_flLastDeathSound = 0f;
//-------------------------------------------------
void Start()
{
destructTime = Time.time + lifetime + Random.value;
hand = GetComponentInParent<Hand>();
balloonRigidbody = GetComponent<Rigidbody>();
}
//-------------------------------------------------
void Update()
{
if ( ( destructTime != 0 ) && ( Time.time > destructTime ) )
{
if ( burstOnLifetimeEnd )
{
SpawnParticles( lifetimeEndParticlePrefab, lifetimeEndSound );
}
Destroy( gameObject );
}
}
//-------------------------------------------------
private void SpawnParticles( GameObject particlePrefab, SoundPlayOneshot sound )
{
// Don't do this twice
if ( bParticlesSpawned )
{
return;
}
bParticlesSpawned = true;
if ( particlePrefab != null )
{
GameObject particleObject = Instantiate( particlePrefab, transform.position, transform.rotation ) as GameObject;
particleObject.GetComponent<ParticleSystem>().Play();
Destroy( particleObject, 2f );
}
if ( sound != null )
{
float lastSoundDiff = Time.time - s_flLastDeathSound;
if ( lastSoundDiff < 0.1f )
{
sound.volMax *= 0.25f;
sound.volMin *= 0.25f;
}
sound.Play();
s_flLastDeathSound = Time.time;
}
}
//-------------------------------------------------
void FixedUpdate()
{
// Slow-clamp velocity
if ( balloonRigidbody.velocity.sqrMagnitude > maxVelocity )
{
balloonRigidbody.velocity *= 0.97f;
}
}
//-------------------------------------------------
private void ApplyDamage()
{
SpawnParticles( popPrefab, null );
Destroy( gameObject );
}
//-------------------------------------------------
void OnCollisionEnter( Collision collision )
{
if ( bParticlesSpawned )
{
return;
}
Hand collisionParentHand = null;
BalloonHapticBump balloonColliderScript = collision.gameObject.GetComponent<BalloonHapticBump>();
if ( balloonColliderScript != null && balloonColliderScript.physParent != null )
{
collisionParentHand = balloonColliderScript.physParent.GetComponentInParent<Hand>();
}
if ( Time.time > ( lastSoundTime + soundDelay ) )
{
if ( collisionParentHand != null ) // If the collision was with a controller
{
if ( Time.time > ( releaseTime + soundDelay ) ) // Only play sound if it's not immediately after release
{
collisionSound.Play();
lastSoundTime = Time.time;
}
}
else // Collision was not with a controller, play sound
{
collisionSound.Play();
lastSoundTime = Time.time;
}
}
if ( destructTime > 0 ) // Balloon is released away from the controller, don't do the haptic stuff that follows
{
return;
}
if ( balloonRigidbody.velocity.magnitude > ( maxVelocity * 10 ) )
{
balloonRigidbody.velocity = balloonRigidbody.velocity.normalized * maxVelocity;
}
if ( hand != null )
{
ushort collisionStrength = (ushort)Mathf.Clamp( Util.RemapNumber( collision.relativeVelocity.magnitude, 0f, 3f, 500f, 800f ), 500f, 800f );
hand.controller.TriggerHapticPulse( collisionStrength );
}
}
//-------------------------------------------------
public void SetColor( BalloonColor color )
{
GetComponentInChildren<MeshRenderer>().material.color = BalloonColorToRGB( color );
}
//-------------------------------------------------
private Color BalloonColorToRGB( BalloonColor balloonColorVar )
{
Color defaultColor = new Color( 255, 0, 0 );
switch ( balloonColorVar )
{
case BalloonColor.Red:
return new Color( 237, 29, 37, 255 ) / 255;
case BalloonColor.OrangeRed:
return new Color( 241, 91, 35, 255 ) / 255;
case BalloonColor.Orange:
return new Color( 245, 140, 31, 255 ) / 255;
case BalloonColor.YellowOrange:
return new Color( 253, 185, 19, 255 ) / 255;
case BalloonColor.Yellow:
return new Color( 254, 243, 0, 255 ) / 255;
case BalloonColor.GreenYellow:
return new Color( 172, 209, 54, 255 ) / 255;
case BalloonColor.Green:
return new Color( 0, 167, 79, 255 ) / 255;
case BalloonColor.BlueGreen:
return new Color( 108, 202, 189, 255 ) / 255;
case BalloonColor.Blue:
return new Color( 0, 119, 178, 255 ) / 255;
case BalloonColor.VioletBlue:
return new Color( 82, 80, 162, 255 ) / 255;
case BalloonColor.Violet:
return new Color( 102, 46, 143, 255 ) / 255;
case BalloonColor.RedViolet:
return new Color( 182, 36, 102, 255 ) / 255;
case BalloonColor.LightGray:
return new Color( 192, 192, 192, 255 ) / 255;
case BalloonColor.DarkGray:
return new Color( 128, 128, 128, 255 ) / 255;
case BalloonColor.Random:
int randomColor = Random.Range( 0, 12 );
return BalloonColorToRGB( (BalloonColor)randomColor );
}
return defaultColor;
}
}
}
<00><>*BalloonValve.VR.InteractionSystemAssembly-CSharp.dll