Example #1
0
    public void GiveSwordToPlayer()
    {
        if (playerInside)
        {
            checkpoint.Activate();
            FindObjectOfType <PlayerSwordScanner>().UnlockSword();
            transform.parent.gameObject.SetActive(false);

            for (int i = 0; i < dialogueTriggers.Length; i++)
            {
                dialogueTriggers[i].SetActive(true);
            }

            for (int i = 0; i < disableObjects.Length; i++)
            {
                disableObjects[i].SetActive(false);
            }

            /*draggables[0].SetActive(false);
             * draggables[1].SetActive(true);*/

            VibrationManager.Instance.Vibrate(VibrationManager.Presets.SUCCESS);

            GeneralMusicManager.Instance.UpdateLevel1Event(0.7f, 0);

            GeneralDialogue.Instance.EnableDialogue("Conversation_2");
            UIHelperController.Instance.DisableHelper(UIHelperController.HelperAction.Pick);
        }
    }
 public void SetCurrentActive(CheckPoint current)
 {
     activeCheckpoint = current;
     activeCheckpoint.Activate(true);
     foreach (CheckPoint checkpoint in checkPoints.FindAll(point => point != activeCheckpoint))
     {
         checkpoint.Activate(false);
     }
 }
Example #3
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();
        }
    }
Example #4
0
 public void ActivateCP(CheckPoint cp)
 {
     cp.Activate();
 }