Esempio n. 1
0
    void OnTriggerEnter(Collider col)
    {
        TorchUsable temp = col.GetComponent <TorchUsable> ();

        if (temp != null)
        {
            GetComponent <Collider> ().enabled = false;

            if (rainatar)
            {
                if (rainatar.isLevDied)
                {
                    return;
                }
                rainatar.isStillHauntingLev = false;
            }

            levC = MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ();
            levC.setInputEnable(false);
            levC.stopMoving();
            levC.OnCustomAnimationFinished += ForceLevMove;

            burnedRope.GetComponentsInChildren <BurnedRopeParticle> ().ForEach(t => t.LightMyFire());
        }
    }
Esempio n. 2
0
    public void Die(DieCausesType causes)
    {
        this.causes = causes;
        levController.setInputEnable(false);
        levController.stopMoving();

        PlayCustomAnimation(causes);
    }
Esempio n. 3
0
 void ForceLevMove(GameObject sender)
 {
     levC.setInputEnable(false);
     levC.stopMoving();
     StartCoroutine(MoveLev(levC));
     if (levC != null)
     {
         levC.OnCustomAnimationFinished -= ForceLevMove;
     }
 }
Esempio n. 4
0
    public override void End(GameObject Actor)
    {
        if (Actor != null)
        {
            levController = Actor.GetComponent <LevController>();

            levController.levSetting.runAcceleration = deceleration;
            levController.stopMoving();
            StartCoroutine(RestoreAcceleration());
        }
    }
Esempio n. 5
0
 public void pick()
 {
     heldPickable = getFirstPickableObject();
     if (heldPickable)
     {
         if (heldPickable.objectLayer == PickableObject.LayerObject.Back)
         {
             levController.turnToBackground();
         }
         else if (heldPickable.objectLayer == PickableObject.LayerObject.Front)
         {
             levController.turnToForeground();
         }
         levController.OnCustomAnimationFinished += handleOnPickFinished;
         levController.playCustomAnimation(heldPickable.pickAnimation);
         levController.stopMoving();
         heldPickable.OnStartLocked();
         isHoldingPickable = true;
     }
 }
 public void startAim()
 {
     if (!isAiming && levController.isGrounded && !levController.isJumping && currentAmmo != null)
     {
         isAiming = true;
         levController.setInputEnable(false);
         levController.stopMoving();
         levController.levAnimator.CrossFade("Base Layer.Aim." + currentAmmo.aimAnimation, 0.1f, 0, 0);
         if (prepareShootCoroutine != null)
         {
             StopCoroutine(prepareShootCoroutine);
         }
         prepareShootCoroutine = StartCoroutine(prepareShoot(0.1f));
     }
 }
Esempio n. 7
0
    public override void Trigger(GameObject Actor)
    {
        if (Actor != null)
        {
            levController = Actor.GetComponent <LevController>();
            if (levController == null)
            {
                Debug.LogError("Actor is does not have Lev Controller");
                return;
            }

            originAcceleration = levController.levSetting.runAcceleration;
            levController.levSetting.runAcceleration = deceleration;
            levController.stopMoving();
            StartCoroutine(RestoreAcceleration());
        }
    }
Esempio n. 8
0
    IEnumerator MoveLev(LevController lev)
    {
        while (lev.transform.position.x < transform.position.x + 2.6f)
        {
            lev.moveRight();
            yield return(null);
        }
        float waktu = 1f;

        lev.facingDirection = LevController.Direction.Left;
        while (waktu > 0f)
        {
            lev.stopMoving();
            waktu -= Time.deltaTime;
            yield return(null);
        }
        triggerCinematic.TriggerThis(0f);
        TorchPickable.StopAllTorches();
        yield return(new WaitForSeconds(1));

        rainatar.rainaAnim.speed = 0;
    }