Example #1
0
    public void Plant()
    {
        Vector3 offset = new Vector3(0, -0.25f, 0);

        gunning = FindObjectOfType <Gunning>();//Refresh the gunning reference because it changes on gun swapping.
        //Instantiate a bomb prefab in front of the player
        Instantiate(deployedBomb, gunning.transform.position + offset, Quaternion.identity);
        //bomb prefab will contain animation and sound
        //bomb prefab has a timer, then explodes.
        //bomb prefab sets bombisplanted to false before exploding
        Debug.Log("The bomb has been planted ! ! ! ");
    }
    void Awake()
    {
        gameManager  = FindObjectOfType <GameManager>();
        levelManager = FindObjectOfType <LevelManager>();
        player       = FindObjectOfType <PlayerController>();
        boss         = FindObjectOfType <Boss>();
        gunning      = FindObjectOfType <Gunning>();
        timesSaved   = 0;

        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(this.gameObject);
    }
Example #3
0
 private void Start()
 {
     gunning = FindObjectOfType <Gunning>();
 }