// Use this for initialization void Start() { coinTotalManager = GameObject.Find("Coin Handler").GetComponent <CoinTotalManager> (); currentStates = GameObject.Find("Power Up Button(Clone)").GetComponent <PowerButtonCurrentStates> (); if (currentStates.GetSingleStarPowerPressed()) { instantiatedPressedSingleStarPowerButton = (GameObject)Instantiate(pressedSingleStarPowerButton, new Vector3(transform.position.x, transform.position.y, transform.position.z - 1), Quaternion.identity); instantiatedPressedSingleStarPowerButton.transform.parent = transform; } incrementalAngle = GameObject.Find("Power Up Button(Clone)").GetComponent <PowerButtonHandler> ().GetIncrementalCircleAngle(); circleObject = GameObject.Find("Single Star Circle"); touchOn = true; soundHandler = GameObject.Find("Game Manager").GetComponent <SoundHandler> (); }
// Use this for initialization void Start() { coinTotalManager = GameObject.Find("Coin Handler").GetComponent <CoinTotalManager> (); currentStates = GameObject.Find("Power Up Button(Clone)").GetComponent <PowerButtonCurrentStates> (); if (currentStates.GetPlusFivePowerPressed()) { float totalCircleAngle = Mathf.Rad2Deg * (2 * (Mathf.Atan(((transform.position.x) / (transform.position.x * .8930232558f))))); float incrementalCircleAngle = totalCircleAngle / 6; instantiatedPressedPlusFivePowerButton = (GameObject)Instantiate(pressedPlusFivePowerButton, new Vector3(transform.position.x, transform.position.y, transform.position.z - 1), Quaternion.identity); instantiatedPressedPlusFivePowerButton.transform.Rotate(new Vector3(0, 0, incrementalCircleAngle)); instantiatedPressedPlusFivePowerButton.transform.parent = transform; } incrementalAngle = GameObject.Find("Power Up Button(Clone)").GetComponent <PowerButtonHandler> ().GetIncrementalCircleAngle(); circleObject = GameObject.Find("Plus Five Circle"); touchOn = true; soundHandler = GameObject.Find("Game Manager").GetComponent <SoundHandler> (); touchHandler = GameObject.Find("Level Controller").GetComponent <RockLevelTouchHandler> (); powerPercentageController = GameObject.Find("Level Controller").GetComponent <PowerPercentageController> (); }