Exemplo n.º 1
0
    private void Update()
    {
        IHuman  h = IHuman.HumanNearbyPosition(trans.position, false, 3);
        IZombie z = IZombie.ZombieNearbyPosition(trans.position, 3, false);

        opened = h || z;

        int r = 0;

        if (opened)
        {
            r = 1;
        }
        float speed = Time.deltaTime * 4f;

        addEuler = Mathf.Lerp(addEuler, r * 120, speed);
        trans.localEulerAngles = new Vector3(startEuler.x, startEuler.y, startEuler.z + addEuler);
    }