Exemplo n.º 1
0
    public void Hit(Node newNode, float speed)
    {
        if (newNode == null)
        {
            Hit();
            return;
        }

        BackInTimeManager.inst.AddAction(new TurnActionMoveHit(crtNode, durability, this));

        HitAction();

        //crtNode.rock = null;
        //LevelManager.inst.UpdateRockNode(crtNode, this, newNode);
        //crtNode = newNode;
        //crtNode.rock = this;

        Pit pit = LevelManager.inst.IsAPit(newNode);

        if (pit != null)
        {
            pit.FullIt();
            m_onAPit = true;
            //m_transform.position = crtNode.worldPosition + Vector3.down;
            Debug.Log("Rock is on a pit", gameObject);
            StartCoroutine(HitAnim(newNode, speed, true));
        }
        else
        {
            StartCoroutine(HitAnim(newNode, speed, false));
        }

        //m_transform.position = crtNode.worldPosition;
    }