コード例 #1
0
    private ShowStarNumber star;                                                        //Define the ShowStarNumber variable to check the number of star and the cost of the defender

    // Use this for initialization
    void Start()
    {
        //Check whether the parent Gameobject exsit or not. If not, create a new GameObject
        defenderParent = GameObject.Find("Defenders");
        if (defenderParent == null)
        {
            defenderParent = new GameObject("Defenders");
        }

        star = GameObject.FindObjectOfType <ShowStarNumber> ();                 //Get the ShowStarNumber
    }
コード例 #2
0
    public int defenderCost = 100;                              //Define the cost of the defender


    // Use this for initialization
    void Start()
    {
        shoot = GetComponent <Shooter> ();                                      //Get the shooter variable
        anim  = GetComponent <Animator> ();                                     //Get the Animator variable
        star  = GameObject.FindObjectOfType <ShowStarNumber> ();                //Get the ShowStarNumber variable
    }