Example #1
0
 void Start()
 {
     vars               = GetComponentInParent <BasePlayerVariables>();
     hitPlayerId        = vars.playerId;
     gameController     = FindObjectOfType <GameManager>();
     gameNetworkManager = FindObjectOfType <GameNetworkManager>();
 }
 public void Start()
 {
     objectTransform = GetComponentInParent <Transform>();
     vars            = GetComponentInParent <BasePlayerVariables>();
     playerNumber    = vars.playerId;
     spriteRenderer  = GetComponentInChildren <SpriteRenderer>();
 }
Example #3
0
    public void Start()
    {
        BasePlayerVariables vars = this.gameObject.GetComponentInParent <BasePlayerVariables>();

        bombsLeft = vars.bombsLeft;
        // TODO: fix this bs
        Vector3 originalPosition = originalBombIcon.transform.position;

        bombIcons.Add(originalBombIcon);

        float length = originalBombIcon.transform.localScale.x;

        float horizontalPadding = originalBombIcon.rectTransform.rect.width + 2;

        if (vars.playerId == 1)
        {
            horizontalPadding = -horizontalPadding;
        }

        for (int i = 1; i < bombsLeft; i++)
        {
            Vector3 newIconPosition = new Vector3(
                originalPosition.x + (horizontalPadding * i),
                originalPosition.y,
                originalPosition.z);

            Image  newIcon = Instantiate(originalBombIcon, newIconPosition, Quaternion.identity);
            Canvas canvas  = FindObjectOfType <Canvas>();
            newIcon.transform.SetParent(canvas.transform);
            bombIcons.Add(newIcon);
        }
    }
Example #4
0
    void Awake()
    {
        // Do I want multiple people to be able to control the pause menu?
        BasePlayerVariables vars = GetComponentInParent <BasePlayerVariables>();

        player          = ReInput.players.GetPlayer(vars.playerId);
        arenaController = FindObjectOfType <GameManager>();
    }
Example #5
0
    private void Awake()
    {
        BasePlayerVariables vars = GetComponentInParent <BasePlayerVariables>();

        body = GetComponent <Rigidbody2D>();

        // Get the Rewired Player object for this player and keep it for the duration of the character's lifetime
        player = ReInput.players.GetPlayer(vars.playerId);
    }
    void Awake()
    {
        vars   = GetComponentInParent <BasePlayerVariables>();
        player = ReInput.players.GetPlayer(vars.playerId);

        baseBulletSpawner = GetComponent <BaseBulletSpawner>();

        bombSpawner = GetComponent <BombSpawner>();
        bombsLeft   = vars.bombsLeft;
    }