Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        dialogueManager = GameObject.Find("Dialogue").GetComponent <DialogueManager>();

        bed1             = new Vector3Int(-4, 0, 0);
        player           = GameObject.Find("Player");
        playerController = player.GetComponent <PlayerController>();
        sleep            = gameObject.transform.GetChild(0).gameObject;
        gameManager      = GameObject.Find("GameManager").GetComponent <GameManager>();
        questionBox      = gameObject.transform.GetChild(1).gameObject;
        questionBox.transform.GetChild(0).gameObject.transform.GetChild(1).gameObject.GetComponent <Button>().onClick.AddListener(() => sleepFadeout());
        questionBox.transform.GetChild(0).gameObject.transform.GetChild(2).gameObject.GetComponent <Button>().onClick.AddListener(() => notSleep());
        sceneFader = GameObject.Find("SceneFadeout").GetComponent <SceneFadeout>();
        questionBox.SetActive(false);
        questNotifications = new Dictionary <string, int>();
        sleepImage         = sleep.GetComponent <Image>();
        npcUI = gameObject.transform.GetChild(2).gameObject;
        npcUI.SetActive(false);
        timer = 0;

        gameManager.transform.GetChild(2).gameObject.SetActive(true);
        gameManager.stockpile  = new Stockpile();
        gameManager.population = 2;

        // testing in mainworld
        npcClone = GameObject.Find("NPCclone");
    }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     rbody                 = GetComponent <Rigidbody2D>();
     anim                  = GetComponent <Animator>();
     canMove               = false;
     inventorySlot         = 0;
     maxSlots              = 1;
     inventory             = gameObject.transform.GetChild(1).gameObject;
     inventorySceneManager = GameObject.Find("InventorySceneManager").GetComponent <InventorySceneManager>();
     inventoryActive       = gameObject.transform.GetChild(1).GetChild(inventorySceneManager.inventoryActive).gameObject;
     deactivateInventorySlots();
     setInventoryItem(inventorySceneManager.inventoryActive);
     sceneFader  = GameObject.Find("SceneFadeout").GetComponent <SceneFadeout>();
     hairAnim    = transform.GetChild(3).gameObject.GetComponent <Animator>();
     bodyAnim    = transform.GetChild(4).gameObject.GetComponent <Animator>();
     clothesAnim = transform.GetChild(5).gameObject.GetComponent <Animator>();
     legsAnim    = transform.GetChild(6).gameObject.GetComponent <Animator>();
 }
Example #3
0
 // Start is called before the first frame update
 void Start()
 {
     sceneFader = GameObject.Find("SceneFadeout").GetComponent <SceneFadeout>();
     rbody      = GetComponent <Rigidbody2D>();
     anim       = GetComponent <Animator>();
     anim.SetFloat("runMultiplyer", 0.8f);
     hairAnim    = transform.GetChild(3).gameObject.GetComponent <Animator>();
     bodyAnim    = transform.GetChild(4).gameObject.GetComponent <Animator>();
     clothesAnim = transform.GetChild(5).gameObject.GetComponent <Animator>();
     legsAnim    = transform.GetChild(6).gameObject.GetComponent <Animator>();
     canMove     = true;
     exit        = new List <Vector3Int>(new Vector3Int[] {
         new Vector3Int(-27, -1, 0),
         new Vector3Int(-27, 0, 0),
         new Vector3Int(-27, 1, 0),
         new Vector3Int(-27, 2, 0),
         new Vector3Int(-27, 3, 0)
     });
     inventory             = gameObject.transform.GetChild(1).gameObject;
     inventoryActive       = inventory.transform.GetChild(0).gameObject;
     inventorySceneManager = GameObject.Find("InventorySceneManager").GetComponent <InventorySceneManager>();
 }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     player     = GameObject.Find("Player");
     collider   = GetComponent <BoxCollider2D>();
     sceneFader = GameObject.Find("SceneFadeout").GetComponent <SceneFadeout>();
 }