// Set starting variables
    void Start()
    {
        rb             = GetComponent <Rigidbody2D> ();
        rb.drag        = drag;
        originalScale  = transform.localScale;
        originalSpeed  = speed;
        originalDrag   = drag;
        falling        = false;
        PU_spawn       = GameObject.FindGameObjectWithTag("BoardArea").GetComponent <Powerup_Spawner> ();
        Bomb           = transform.GetChild(0).GetComponent <CircleCollider2D> ();
        originalRadius = Bomb.radius;
        num_bombs      = 0;

        Player_Inputs = new string[2];

        if (tag == "Player1")
        {
            Player_Inputs [0] = "VerticalP1";
            Player_Inputs [1] = "HorizontalP1";
        }

        if (tag == "Player2")
        {
            Player_Inputs [0] = "VerticalP2";
            Player_Inputs [1] = "HorizontalP2";
        }
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     base.Start();
     if (P_Spawner == null)
     {
         P_Spawner = GameObject.FindGameObjectWithTag("GameController").GetComponent <Powerup_Spawner>();
     }
     SetHealthCost(0.6f);
 }