示例#1
0
 void Start()
 {
     thisPowerTrail = GetComponent <PowerTrail>();
     if (whatToControl == PowerControl.powerOnAndOff || whatToControl == PowerControl.powerOnOnly)
     {
         button.OnButtonPressBegin += b => thisPowerTrail.powerIsOn = true;
     }
     if (whatToControl == PowerControl.powerOnAndOff || whatToControl == PowerControl.powerOffOnly)
     {
         button.OnButtonUnpressFinish += b => thisPowerTrail.powerIsOn = false;
     }
 }
 void Start()
 {
     powerTrail = GetComponent <PowerTrail>();
     receptacle.OnCubeHoldEndSimple      += () => powerTrail.powerIsOn = true;
     receptacle.OnCubeReleaseStartSimple += () => powerTrail.powerIsOn = false;
 }