Esempio n. 1
0
 private bool isButtonBroken;  //the current status of the button
 // Use this for initialization
 void Start()
 {
     hammerScript   = hammer.GetComponent <hammerCrush>();
     buttonScript   = button.GetComponent <buttonTrigger>();
     isHammerBroken = hammerScript.isBroken;
     isButtonBroken = buttonScript.isBroken;
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     currentAngle = transform.eulerAngles;
     buttonScript = button.GetComponent <buttonTrigger>(); //gets the button script to handle if the hammer should activate
     if (!buttonScript)                                    //error to catch changes to the buttonTrigger script
     {
         Debug.LogError("Error!: hammerCrush did not find the buttonScript");
     }
 }