//Add more once we have more Player based scripts. public void Setup() { playerController = playerObj.GetComponent<PlayerController>(); playerMouseRotator = playerObj.GetComponent<MouseRotator>(); playerNetwork = playerObj.GetComponent<PlayerNetwork>(); playerNetwork.lobbyName = playerName; playerNetwork.pColor = syncColor; playerNetwork.playerNumber = playerID; }
void Start() { myRigidbody = GetComponent <Rigidbody2D>(); mouseRotatorObject = FindObjectOfType <MouseRotator>(); health = FindObjectOfType <Health>(); var mouseRotator = mouseRotatorObject.GetComponent <MouseRotator>(); var direction = mouseRotator.GetMouseDirectionVector(); myRigidbody.velocity = direction * bulletVelocity; }