// Start is called before the first frame update void Start() { damagedTile = null; pab = transform.parent.GetComponent <PlayersAssemblyBehavior>(); damageGrid = transform.parent.parent.GetComponentInChildren <DamageGridBehavior>(); playerInput = PlayerInput.GetInputReceiver(pab.GetPlayerIndex(transform)); }
// Start is called before the first frame update void Start() { body = GetComponent <Rigidbody2D>(); p = GetComponentInParent <PlayersAssemblyBehavior>(); input = PlayerInput.GetInputReceiver(p.GetPlayerIndex(transform)); anim = GetComponent <Animator>(); }
// Start is called before the first frame update void Start() { //// Set up physics body-based rotation //raftBody = transform.Find("Raft").GetComponent<Rigidbody2D>(); //raftBody.angularVelocity = -spinPerSecond; //raftBody.angularDrag = 0f; players = GetComponentInChildren <PlayersAssemblyBehavior>(); // Scale angularVelocity linearly from 8 (1 player) to 20 (4 playes) uint numPlayers = GlobalGameData.numPlayers; if (numPlayers == 0) { numPlayers = 1; // for testing (no players) } angularVelocity = minAngularVelocity + (numPlayers - 1) * (maxAngularVelocity - minAngularVelocity) / 3; }