Esempio n. 1
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     MapManager.speed = 0;
     defCanvas.SetActive(false);
     Canvas.SetActive(true);
     DialManager.SetActive(true);
 }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (MapManager.check)
        {
            placeTxt.text = "";
        }

        if (MapManager.check)
        {
            player[0].transform.Translate(2 * Time.deltaTime, 0, 0);
        }
        if (player[0].transform.position.x < initPos.x && !MapManager.check)
        {
            player[0].transform.Translate(Time.deltaTime, 0, 0);
        }

        npcPos.GetComponent <Animator>().runtimeAnimatorController =
            Resources.Load <RuntimeAnimatorController>("anime/bird_" + MapManager.birdType.ToString())
            as RuntimeAnimatorController;

        npcPos.transform.Translate(-1 * speed * Time.deltaTime, 0, 0);
        if (!DialManager.activeSelf)
        {
            speed = 3;
            player[0].SetActive(true);
            player[1].SetActive(false);
            defCanvas.SetActive(true);
            //StartCoroutine(NowMoving());
        }
        else
        {
            speed = 0;
            player[0].SetActive(false);
            player[1].SetActive(true);
            motion.transform.position =
                npcPos.transform.position + new Vector3(0, 1.2f, 0);
        }
        if (!DialogManager.talkStart)
        {
            Canvas.SetActive(false);
            DialManager.SetActive(false);
            motion.SetActive(false);
        }
    }