コード例 #1
0
 void Start()
 {
     PickupScript = GameObject.Find ("PC").GetComponent<TL_Pickup>();
     rb_Gravity = GetComponent<Rigidbody>();
 }
コード例 #2
0
    void Start()
    {
        go_PC = GameObject.Find ("PC");
        PickUpScript = go_PC.GetComponent<TL_Pickup>();

        foreach(Transform tr_Cubes in transform)
        {
            //Stores the initial positions and gameobjects in a list
            if(tr_Cubes.gameObject.tag == "Destructible")
            {
                lt_Cubes.Add (tr_Cubes.gameObject);
                lt_Destructibles.Add (tr_Cubes.position);
            }

            if(tr_Cubes.gameObject.tag == "Weight")
            {
                lt_Weights.Add (tr_Cubes.gameObject);
                lt_WeightPos.Add (tr_Cubes.position);
            }
        }
        //Sets the value of the cubes count to the variable
        in_Count = lt_Cubes.Count;
    }