Esempio n. 1
0
    public void FinishStab()
    {
        if (CanFinallyStab())
        {
            transform.parent = null;

            if (swordHolder.CompareTag("MoveObject"))
            {
                var moveObject = swordHolder.GetComponent <PushPullObject>();
                if (moveObject)
                {
                    moveObject.swordStabbed = true;
                }
                else
                {
                    moveObject = swordHolder.transform.parent.gameObject.GetComponent <PushPullObject>();
                    moveObject.swordStabbed = true;
                }

                transform.parent = null;
                _parenting.InjectTransform(moveObject.transform);
            }

            if (swordHolder.CompareTag("CheckPoint"))
            {
                CheckPoint c = swordHolder.GetComponent <CheckPoint>();
                c.Activate();

                CheckpointSound();
            }

            if (!swordHolder.CompareTag("MoveObject"))
            {
                transform.parent = swordHolder.transform;
            }

            if (swordHolder.GetComponent <Switchable>() != null)
            {
                swordHolder.GetComponent <Switchable>().SwitchOn();
            }

            if (activeScanner)
            {
                _scannerIntersectionManager.CheckIntersections();
            }

            StabSound();
        }
    }
Esempio n. 2
0
 public void CheckCollisions()
 {
     scannerIntersect.CheckIntersections();
 }