Exemple #1
0
 void Start()
 {
     if (trigger == null)
     {
         trigger = GetComponent <ProximityTriggerAction>();
     }
     trigger.triggerEnterDelegate += EventOccurred;
 }
        void Start()
        {
            ThirstQuencher = GetComponentInChildren <ProximityTriggerAction>();
            ThirstQuencher.triggerStayDelegate += CheckDrinkingWhiskey;
            ThirstQuencher.triggerExitDelegate += StopDrinking;

            gulpSource = AudioManager.Inst.MakeSource("Bottle/DrinkingInGulps");
            gulpSource.transform.SetParent(VRMimic.Instance.VRCamera.transform);
            gulpSource.transform.localPosition = Vector3.up * -.4f;
            gulpSource.volume = 0;
            gulpSource.loop   = true;
            gulpSource.Play();

            myDestroyable = GetComponent <Destroyable>();
            myExplodable  = GetComponent <Explodable>();
            myExplosion   = GetComponent <Explosion>();

            //if (swishCalculator != null)
            //{
            //swishCalculator = transform.FindChild("bottle2").FindChild("Whiskey Swish").GetComponent<Swish>();
            //}
            //myExplodable.HitByExplosionDelegate += HitByExplosion;
        }