コード例 #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;
 }
コード例 #2
0
ファイル: hammerCrush.cs プロジェクト: DHalsey/Wacktory
 // 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");
     }
 }