private void Start()
 {
     p1c                 = GetComponent <player1Controller>();
     currentChar         = getRandomChar();
     blackScreenRenderer = BlackScreen.GetComponent <SpriteRenderer>();
     initKeysMap();
 }
Example #2
0
    void Start()
    {
        player1         = player1Obj.GetComponent <player1Controller>();
        player2         = player2Obj.GetComponent <player2Controller>();
        playerBodies    = new Rigidbody2D[2];
        playerBodies[0] = player1Obj.GetComponent <Rigidbody2D>();
        playerBodies[1] = player2Obj.GetComponent <Rigidbody2D>();

        chainBodies  = new List <Rigidbody2D>();
        chainSprings = new List <SpringJoint2D>();

        foreach (GameObject chain in chains)
        {
            chainBodies.Add(chain.GetComponent <Rigidbody2D>());
            foreach (SpringJoint2D spring in chain.GetComponents <SpringJoint2D>())
            {
                chainSprings.Add(spring);
            }
        }

        int i = 0;

        foreach (string key in physVals.Keys)
        {
            float min  = physVals[key][0];
            float max  = physVals[key][1];
            float init = physVals[key][2];
            createValueSlider(key, min, max, init, sliderPos, -yOffset * i);
            i++;
        }
    }
Example #3
0
 void Start()
 {
     playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <player1Controller>();
     bulletBody       = GetComponent <Rigidbody2D>();
 }