// Use this for initialization void Start() { PlayerInput.inputPolled += MoveAndShoot; //make sure we're subscribed to the event out of Player Input body = GetComponentInChildren <PlayerBody>(); rb = GetComponent <Rigidbody>(); // Connect our rigidbody variable to our rigidbody component attackComponent = GetComponent <IPlayerAttack>(); //cache a reference to our attack script }
public void ClearData() { _IPlayerAttack = null; _IPlayerMove = null; }
public void Attack(IPlayerAttack playerAttack) { playerAttack.Attack(); }
public void SetData(IPlayerAttack playerAttack, IPlayerMove playerMove, int userId) { _IPlayerAttack = playerAttack; _IPlayerMove = playerMove; _UserId = userId; }