Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (mc == null)
        {
            mc = FindObjectOfType <musicController>();
        }

        if (Input.GetKeyDown(KeyCode.E) && playerEnter)
        {
            mc.switchTrack(3);
            mc.musicCanPlay = true;
            cgman.textLines = lines;
            cgman.textimage = img;

            cgman.images = images;


            if (!cgman.cgActive)
            {
                cgman.currentLine = 0;
                cgman.showDialogue();
                istriggered = true;
            }
        }


        if (cgman.currentLine == 13 && istriggered)
        {
            lna.loadFromDialogue("palawan");
            istriggered = false;
            playerEnter = false;
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (mc == null)
        {
            mc = FindObjectOfType <musicController>();
        }
        if (xpm == null)
        {
            xpm = FindObjectOfType <experienceManager>();
        }

        if (questIndex == 2)
        {
            if (wolfcount == 8)
            {
                StartCoroutine("restoretownstate");
            }
        }

        if (questIndex == 3)
        {
            if (recruitCount == 3)
            {
                questCompleted();
            }
        }
    }
Exemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     if (mc == null)
     {
         mc = FindObjectOfType <musicController>();
     }
 }
Exemplo n.º 4
0
	// Use this for initialization
	void Start () {
		theMC = FindObjectOfType<musicController> ();

		if (switchOnStart) {
			theMC.SwitchTrack (newTrack);
			gameObject.SetActive (false);

		}
	}
Exemplo n.º 5
0
 void Awake()
 {
     if (ins == null)
     {
         ins = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
     else if (ins != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Exemplo n.º 7
0
 void MakeSingleton()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     mc = FindObjectOfType <musicController>();
     if (switchOnStart)
     {
         mc.switchTrack(newTrack);
         gameObject.SetActive(false);
     }
     else if (!musicOnPlay)
     {
         mc.musicCanPlay = false;
         gameObject.SetActive(false);
     }
 }
Exemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        if (mc == null)
        {
            mc = FindObjectOfType <musicController>();
        }
        if (thePlayer == null)
        {
            thePlayer = FindObjectOfType <PlayerMovement2>();
        }

        if (Input.GetKeyDown(KeyCode.E) && playerEnter)
        {
            questInstance1();
        }
        if (dMan.currentLine == 20 && playerEnter)
        {
            dMan.buttonActive = true;
            btntext.text      = btext;
            btntext2.text     = btext2;

            btn1.SetActive(true);
            btn2.SetActive(true);
        }

        if (cgman.currentLine == 3 && cgistriggered == true)
        {
            dMan.background.gameObject.SetActive(true);
            cgistriggered = false;
            playerEnter   = false;
            questInstance2();
        }

        if (!dMan.dialogActive && istriggered && !load)
        {
            istriggered = false;
        }

        if (!dMan.dialogActive && istriggered && load)
        {
            lna.loadFromDialogue("Level3");

            istriggered = false;
            //dMan.background.gameObject.SetActive(false);
        }
    }
Exemplo n.º 10
0
    // Update is called once per frame
    void Update()
    {
        if (mc == null)
        {
            mc = FindObjectOfType <musicController>();
        }
        if (pr == null)
        {
            pr = FindObjectOfType <UIManager>();
        }
        if (Input.GetKeyDown(KeyCode.E) && playerEnter)
        {
            if (qmp.questIndex == 0)
            {
                questInstance1();
            }
            if (qmp.questIndex == 2)
            {
                questInstance2();
            }
        }



        if (!dMan.dialogActive && istriggered)
        {
            istriggered = false;
            qmp.questCompleted();
        }

        if (!dMan.dialogActive && istriggered2)
        {
            Debug.Log("INnnnn");
            istriggered2 = false;
            runCG();
        }

        if (cgistriggered == true && !cgman.cgActive)
        {
            Debug.Log("iinnn");
            pr.showGameOver();
            cgistriggered = false;
        }
    }
Exemplo n.º 11
0
 // Update is called once per frame
 void Update()
 {
     if (mc == null)
     {
         mc = FindObjectOfType <musicController>();
     }
     if (Input.GetKeyDown(KeyCode.E) && playerEnter)
     {
         if (qmp.questIndex == 2)
         {
             mc.switchTrack(2);
             questInstance1();
         }
         else
         {
             questInstance2();
         }
     }
     if (!dMan.dialogActive && istriggered)
     {
         qmp.questCompleted();
         istriggered = false;
     }
 }
Exemplo n.º 12
0
    // Update is called once per frame
    void Update()
    {
        if (mc == null)
        {
            mc = FindObjectOfType <musicController>();
        }

        if (xpm == null)
        {
            xpm = FindObjectOfType <experienceManager>();
        }
        if (questIndex == 2)
        {
            if (bananaCount == 5)
            {
                questCompleted();
            }
        }

        if (questIndex == 5)
        {
            if (wolfcount == 3)
            {
                npcController npCont = GameObject.FindObjectOfType <npcController>().GetComponent <npcController>();
                npCont.set1State(false);
                npCont.set2State(true);

                zCont.zone1State(true);
                wolfcount = 0;
                questCompleted();
            }
        }
        if (questIndex == 7)
        {
            if (wolfcount == piratemax)
            {
                Debug.Log("in");
                for (int x = 0; x < piratesc.Length; x++)
                {
                    piratesc[x].canMove = false;
                }
                dMan.textLines = lines;
                dMan.textimage = img;
                dMan.textName  = charac;
                dMan.img       = img;
                dMan.images    = images;

                if (!dMan.dialogActive && !istriggered)
                {
                    dMan.showDialogue();
                    dMan.currentLine = 0;
                    istriggered      = true;
                    wolfcount        = 0;
                }
            }
            if (!dMan.dialogActive && istriggered)
            {
                StartCoroutine("restoretownstate");
            }
        }
    }
Exemplo n.º 13
0
    // Update is called once per frame
    void Update()
    {
        if (mc == null)
        {
            mc = FindObjectOfType <musicController>();
        }
        if (thePlayer == null)
        {
            thePlayer = FindObjectOfType <PlayerMovement2>();
        }
        if (playerEnter)
        {
            if (!dMan.isreply)
            {
                dMan.textLines = lines;
                dMan.textimage = img;
                dMan.textName  = charac;
                dMan.images    = images;


                if (dMan.currentLine == 3)
                {
                    dMan.buttonActive = true;
                    btntext.text      = btext;
                    btntext2.text     = btext2;
                    btn1.SetActive(true);
                    btn2.SetActive(true);
                }



                if (!dMan.dialogActive)
                {
                    dMan.showDialogue();
                    dMan.currentLine = 0;
                }
            }
            else if (dMan.isreply)
            {
                dMan.textLines = Replines;
                dMan.textimage = Repimg;
                dMan.textName  = Repcharac;
                istriggered    = true;
                playerEnter    = false;
            }
        }


        if (!dMan.dialogActive && istriggered)
        {
            zCont.zone1State(false);
            zCont.battleOn(true);
            thePlayer.incutscene = false;
            qmp.questCompleted();
            for (int x = 0; x < piratesc.Length; x++)
            {
                piratesc[x].canMove = true;
            }

            istriggered = false;
        }
    }
Exemplo n.º 14
0
 // Start is called before the first frame update
 void Start()
 {
     damageCalc = GameObject.FindGameObjectWithTag("Player").GetComponent <damageCalculate>();
     GameObject.FindGameObjectWithTag("Music").GetComponent <AudioSource>().Stop();
     mc = GameObject.FindGameObjectWithTag("Music").GetComponent <musicController>();
 }
Exemplo n.º 15
0
    // Update is called once per frame
    void Update()
    {
        if (mc == null)
        {
            mc = FindObjectOfType <musicController>();
        }
        if (pr == null)
        {
            pr = FindObjectOfType <UIManager>();
        }
        if (Input.GetKeyDown(KeyCode.E) && playerEnter)
        {
            if (qmp.questIndex > 8)
            {
                questInstance1();
                if (qmp.questIndex == 9)
                {
                    qmp.questCompleted();
                }
            }
        }

        if (dMan.currentLine == 7 && playerEnter)
        {
            dMan.buttonActive = true;
            btntext.text      = btext;
            btntext2.text     = btext2;
            btntext3.text     = btext3;
            btn1.SetActive(true);
            btn2.SetActive(true);
            btn3.SetActive(true);
        }

        if (!dMan.dialogActive && istriggered && !load)
        {
            istriggered = false;
        }



        if (cgman.currentLine == 17 && cgistriggered == true)
        {
            dMan.background.gameObject.SetActive(true);
            cgistriggered = false;
            playerEnter   = false;
            questInstance2();
        }

        if (!dMan.dialogActive && istriggered && load)
        {
            lna.loadFromDialogue("Level2");

            istriggered = false;
            //dMan.background.gameObject.SetActive(false);
        }
        if (cgistriggered && badending && !cgman.cgActive)
        {
            Debug.Log("ello");
            pr.showGameOver();
            cgistriggered = false;
            badending     = false;
        }
    }