コード例 #1
0
    public static void Pac()
    {
        GameObject pac = (GameObject)Instantiate(Resources.Load("Pac"));

        pac.transform.SetParent(GameObject.Find("Canvas").transform, false);
        ForestPlayer player = GameObject.Find("AudioSource").GetComponent <ForestPlayer>();

        player.BearAttack();
    }
コード例 #2
0
    public static void AttackWithWood()
    {
        GameObject wood         = GameObject.Find("Wood(Clone)");
        Animator   woodAnimator = wood.GetComponent <Animator>();

        woodAnimator.SetTrigger("Attack");
        ForestPlayer player = GameObject.Find("AudioSource").GetComponent <ForestPlayer>();

        player.Torch();
    }
コード例 #3
0
 void Start()
 {
     plot         = GetComponent <Plot> ();
     forestPlayer = audioSource.GetComponent <ForestPlayer>();
     //Debug.Log (defaultText);
 }