Example #1
0
 void Awake()
 {
     _interact          = GetComponent <InteractScript>();
     questManager       = GameObject.Find("GameManager").GetComponent <QuestManager>();
     ui                 = GameObject.Find("Canvas").GetComponent <UIManager>();
     progressionManager = GameObject.Find("GameManager").GetComponent <ProgressionManager>();
 }
    //Scene Functions
    public void indexContent()
    {
        //Create Lists
        items   = new List <GameObject>();
        enemies = new List <GameObject>();
        puzzles = new List <GameObject>();

        //Interacts
        GameObject[] interacts = GameObject.FindGameObjectsWithTag("Interact");
        foreach (GameObject interact in interacts)
        {
            InteractScript insect = interact.GetComponent <InteractScript>();
            if (insect.compareInteractTag("Item"))
            {
                items.Add(interact);
            }
            else if (insect.compareInteractTag("Puzzle"))
            {
                puzzles.Add(interact);
            }
        }

        items   = sortByPosition(items);
        puzzles = sortByPosition(puzzles);

        //Enemies
        GameObject[] enemies_ = GameObject.FindGameObjectsWithTag("Enemy");
        foreach (GameObject enemy in enemies_)
        {
            enemies.Add(enemy);
        }

        enemies = sortByPosition(enemies);
    }
Example #3
0
 //Change the text that shows how to interact
 public void ChangeInteractText(InteractScript interactObject)
 {
     if (!Camera.main.GetComponent <CameraController>().inCutscene)
     {
         interactTextObject.GetComponent <Animator>().SetBool("FadeIn", true);
         interactText.text = "Press Z to " + interactObject.interactText;
     }
     else
     {
         interactText.text = "";
     }
 }
    void Awake()
    {
        player      = GetComponent <PlayerCoreController> ();
        lightObject = GameObject.Find("Directional Light");
        lightSet    = FindObjectOfType <Light> ();

        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
        }
    }
    //public DialogueTrigger dialogue;

    private void Update()
    {
        if (PlayerScript.Active && Input.GetKeyDown(KeyCode.Space))
        {
            bool keep = false;
            if (currBlock != null)
            {
                //dialogue.TriggerDialogue();
                InteractScript iS = currBlock.GetComponent <InteractScript>();

                if (iS != null)
                {
                    DialogueTrigger dialogue = currBlock.GetComponent <DialogueTrigger>();
                    if (dialogue != null)
                    {
                        //Time.timeScale = 0;
                        dialogue.TriggerDialogue();
                        //Time.timeScale = 1;
                        //if (Input.GetKeyDown(KeyCode.Return)) // this is never reached
                        //{
                        // FindObjectOfType<DialogueManager>().DisplayNextSentence();
                        //}
                    }
                    keep = iS.Interact();
                }
                if (!keep)
                {
                    currBlock = null;
                }
            }
        }

        /*
         * else if (Input.GetKeyDown(KeyCode.G)) {
         *  InventoryScript stuff = PlayerScript.inventory;
         *  GameObject drop = stuff.RemoveItem();
         *  if (drop != null)
         *  {
         *      currBlock = drop; //Need to figure out how to actually drop the item onto the floor
         *  }
         *
         * }*/
    }
Example #6
0
 // Start is called before the first frame update
 void Start()
 {
     scripttodisplaytext = (InteractScript)FindObjectOfType(typeof(InteractScript));
     count = (JerseyCount)FindObjectOfType(typeof(JerseyCount));
     StartCoroutine("Police");
 }
Example #7
0
 internal Animate(InteractScript interact, TheOctadecayottonScript octadecayotton)
 {
     _interact       = interact;
     _octadecayotton = octadecayotton;
 }