示例#1
0
 /**
  * Initialize power and target positions
  */
 void Start()
 {
     pow          = this.gameObject.GetComponent <Field_Power> ();
     rb           = this.gameObject.GetComponent <Rigidbody2D> ();
     power        = pow.defOn;
     defaultpower = power;
     if (vertical)
     {
         maxpos = transform.position.y + max;
         minpos = transform.position.y - min;
     }
     else
     {
         maxpos = transform.position.x + max;
         minpos = transform.position.x - min;
     }
 }
 /**
  * Initialize pow and hazard
  */
 void Start()
 {
     pow           = this.gameObject.GetComponent <Field_Power> ();
     defaulthazard = pow.defOn;
     isHazard      = defaulthazard;
 }
 /**
  * Initialize pow
  */
 void Start()
 {
     pow = this.gameObject.GetComponent <Field_Power> ();
 }