Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MenuScript : MonoBehaviour {
- [HideInInspector]
- public Vector3 blueScale;
- [HideInInspector]
- public Vector3 orangeScale;
- [HideInInspector]
- public Vector3 yellowScale;
- [HideInInspector]
- public Vector3 purpleScale;
- [HideInInspector]
- public Vector3 greenScale;
- [HideInInspector]
- public Vector3 redScale;
- public float blueEnergy;
- public float greeEnergy;
- public float orangeEnergy;
- public float purpleEnergy;
- public float redEnergy;
- public float yellowEnergy;
- [HideInInspector]
- public Transform blue;
- [HideInInspector]
- public Transform green;
- [HideInInspector]
- public Transform orange;
- [HideInInspector]
- public Transform purple;
- [HideInInspector]
- public Transform red;
- [HideInInspector]
- public Transform yellow;
- public GameObject _blue;
- private GameObject _green;
- private GameObject _orange;
- private GameObject _purple;
- private GameObject _red;
- private GameObject _yellow;
- private GameObject _refBlue;
- //EnemyHealthBar enemyHealthLeft;
- void Start()
- {
- FindItemsObjects ();
- }
- void OnGUI()
- {
- if(GUI.Button(new Rect(10,120,100,50), "New Level"))
- {
- DeleteItems();
- CreateItems();
- FindItemsObjects();
- }
- }
- public Transform FindChild( GameObject parent, string name)
- {
- if (parent.name == name)
- {
- Debug.Log("Parent's Name is same as you are searching for");
- return null;
- }
- Transform pTransform = parent.GetComponent<Transform> ();
- foreach (Transform t in pTransform)
- {
- if (t.name == name)
- {
- return t;
- }
- }
- return null;
- }
- public void FindItemsObjects()
- {
- DontDestroyOnLoad (_blue);
- //energyBarSprite = bluePrefab.GetComponent<SpriteRenderer> ();
- _blue = GameObject.Find ("Item_bbg(Clone)");
- Debug.Log ("/nBLUE TOOOOO" + _blue);
- blue = FindChild ( _blue, "line");
- _green = GameObject.Find ("Item_gbg(Clone)");
- green = FindChild ( _green, "line");
- Debug.Log ("/nBLUE TOOOOO" + _green);
- _orange = GameObject.Find ("Item_obg(Clone)");
- orange = FindChild ( _orange, "line");
- _purple = GameObject.Find ("Item_pbg(Clone)");
- purple = FindChild ( _purple, "line");
- _red = GameObject.Find ("Item_rbg(Clone)");
- red = FindChild ( _red, "line");
- _yellow = GameObject.Find ("Item_ybg(Clone)");
- yellow = FindChild ( _yellow, "line");
- blueScale = blue.localScale;
- Debug.Log (blueScale);
- orangeScale = orange.localScale;
- yellowScale = yellow.localScale;
- purpleScale = purple.localScale;
- greenScale = green.localScale;
- redScale = red.localScale;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement