Ejemplo n.º 1
0
 // 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));
 }
Ejemplo n.º 2
0
    // 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;
    }