Esempio n. 1
0
 void Start()
 {
     rb                = transform.parent.parent.GetComponent <Rigidbody2D>();
     shieldPivot       = transform.parent.gameObject;
     shieldPivotScript = GetComponentInParent <ShieldPivot>();
     playerController  = transform.parent.parent.GetComponent <PlayerController>();
     boostsLeft        = maxBoost;
 }
Esempio n. 2
0
 void Awake()
 {
     player            = GameObject.Find("Player");
     playerController  = player.GetComponent <PlayerController>();
     shieldPivot       = GameObject.Find("Shield Pivot");
     shieldPivotScript = shieldPivot.GetComponent <ShieldPivot>();
     shieldRB          = GetComponent <Rigidbody2D>();
     shieldDirection   = shieldPivotScript.boost.normalized;
     shieldRB.velocity = shieldDirection * speed;
 }