コード例 #1
0
 public override void LookFunction()
 {
     if (count > scriptEndTimeLook && !isBroken)
     {
         if (target.GetComponent <SlidingDoor>() != null)
         {
             target.GetComponent <SlidingDoor>().force_activation_state(false);
         }
         else
         {
             target.isActivating = false;
         }
         broken = true;
         AkSoundEngine.PostEvent(stopChargingSound, gameObject);
         AkSoundEngine.PostEvent(breakSound, gameObject);
         AkSoundEngine.PostEvent(dogDeathSound, target.gameObject);
         blinkingLight.Break();
         Break();
         scriptEndElevator.Activate();
         StartCoroutine(DogDeathCoroutine());
     }
     else
     {
         base.LookFunction();
     }
 }
コード例 #2
0
    void GetPressed()
    {
        if (b1BoxCollider.IsTouchingLayers(LayerMask.GetMask("Player")) && b2BoxCollider.IsTouchingLayers(LayerMask.GetMask("Player")))
        {
            if (!b1BoxCollider.isTrigger && !b2BoxCollider.isTrigger)
            {
                if (forGate)
                {
                    gateScript.Activate();
                }
                if (forBridge)
                {
                    bridgeScript.Activate();
                }
                if (forElevator)
                {
                    elevatorScript.Activate();
                }
                if (for2Elevators)
                {
                    elevatorScript.Activate();
                    elevator2Script.Activate();
                }
                if (forFire)
                {
                    IEnumerator WaitToKillFire()
                    {
                        yield return(new WaitForSeconds(1f));

                        Destroy(fire);
                    }

                    StartCoroutine(WaitToKillFire());
                }
            }
            b1BoxCollider.isTrigger     = true;
            b1CapsuleCollider.isTrigger = true;
            b2BoxCollider.isTrigger     = true;
            b2CapsuleCollider.isTrigger = true;
        }
    }
コード例 #3
0
ファイル: ElevatorTrigger.cs プロジェクト: bendova/AlmostHero
    // Update is called once per frame
    void Update()
    {
        if (m_isPlayerInBounds)
        {
            if (Input.GetButtonUp("Use"))
            {
                Debug.Log("Update() activating elevator");

                m_elevator.Activate();
            }
        }
    }
コード例 #4
0
ファイル: LiftEnergy.cs プロジェクト: errues/GGJ2020
 private void PowerOn()
 {
     energyOn = true;
     elevator.Activate();
     foreach (GameObject go in lights)
     {
         go.SetActive(true);
     }
     HideInteraction();
     StartCoroutine(WaitToNextBlackout());
     powerAudioSource.PlayOneShot(powerOnClip);
 }
コード例 #5
0
 private void Update()
 {
     if (InputSplitter.GetInteractPressed(fpsMove.PlayerID))
     {
         RaycastHit hitInfo;
         if (Physics.Raycast(cameraTransform.position, cameraTransform.forward, out hitInfo,
                             InteractDistance, interactLayer))
         {
             if (hitInfo.collider.gameObject.layer == airconLayer)
             {
                 GameObject hitObj           = hitInfo.transform.parent.gameObject;
                 Aircon     airconController = hitObj.GetComponent <Aircon>();
                 if (airconController)
                 {
                     airconController.Activate();
                 }
             }
             else if (hitInfo.collider.gameObject.layer == doorLayer)
             {
                 GameObject hitObj         = hitInfo.transform.parent.parent.gameObject;
                 Door       doorController = hitObj.GetComponent <Door>();
                 if (doorController)
                 {
                     doorController.Activate();
                 }
             }
             else if (hitInfo.collider.gameObject.layer == elevatorActivateLayer)
             {
                 GameObject hitObj             = hitInfo.transform.parent.gameObject;
                 Elevator   elevatorController = hitObj.GetComponent <Elevator>();
                 if (elevatorController)
                 {
                     elevatorController.Activate();
                 }
             }
             else if (hitInfo.collider.gameObject.layer == elevatorSlowActivateLayer)
             {
                 Elevator elevatorController = elevatorTerminal.GetComponent <Elevator>();
                 if (elevatorController)
                 {
                     elevatorController.ActivateSlow();
                 }
             }
         }
     }
     if (InputSplitter.GetSmokePressed(fpsMove.PlayerID))
     {
         smokeBombController.Activate();
     }
 }
コード例 #6
0
    void GetPressed()
    {
        if (myCapsuleCollider.IsTouchingLayers(LayerMask.GetMask("Player")))
        {
            if (active)
            {
                if (forGate)
                {
                    gateScript.Activate();
                }
                if (forBridge)
                {
                    bridgeScript.Activate();
                }
                if (forElevator)
                {
                    elevatorScript.Activate();
                }
                if (forWaterfall)
                {
                    waterfallScript.StopWaterfall();
                }
                if (forFire)
                {
                    IEnumerator WaitToKillFire()
                    {
                        yield return(new WaitForSeconds(1f));

                        Destroy(fire);
                    }

                    StartCoroutine(WaitToKillFire());
                }
            }
            active = false;
        }
    }