Ejemplo n.º 1
0
 public void SetData(Paca newPaca)
 {
     paca        = newPaca;
     wearingPaca = GetComponent <WearingPaca>();
     wearingPaca.WearNewPaca(paca);
     GetComponent <Animator>().runtimeAnimatorController = paca.alpacaAnimator;
 }
Ejemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D other)
    {
//		Debug.Log ("collide");
        GameObject otherObj = other.gameObject;

        if (otherObj.CompareTag("PacaNPC"))
        {
//			Debug.Log ("other is paca npc");
            WearingPaca otherWearingPaca = otherObj.GetComponent <WearingPaca> ();
            Paca        otherPaca        = otherWearingPaca.LostWearPaca();

            Player.instance.PlayStealPacaClip();
            if (null != otherPaca)
            {
                wearingPaca.WearNewPaca(otherPaca);
                var otherPacaMove = otherObj.GetComponent <PacaMove>();
                if (null != otherPacaMove)
                {
                    otherPacaMove.StartFlee();
                }
            }

            try{
                if (NPZ && (false == stealStat.ContainsKey(otherPaca)))
                {
                    Player.instance.StartNewPacaZoomIn();
                    stealStat[otherPaca] = 1;
                }
                else
                {
                    stealStat[otherPaca]++;
                }
            }
            catch (System.Exception e) {
                ;
            }

            /*
             *
             */
        }
    }