Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     Physics2D.IgnoreCollision(transform.parent.GetComponent <Collider2D>(), GetComponent <Collider2D>());
     rb            = GetComponent <Rigidbody2D>();
     joyController = FindObjectOfType <JoyController>();
     pidController = new PIDController();
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Awake()
 {
     originalSpriteColor    = GetComponent <SpriteRenderer>().sprite;
     originalSpriteNonColor = transform.GetChild(1).GetComponent <SpriteRenderer>().sprite;
     pText = Instantiate(Resources.Load <GameObject>("PText"), GameObject.Find("GameScreen").transform);
     pText.GetComponent <Text>().text = "P" + playerNum.ToString();
     startPosition        = transform.position;
     rb                   = GetComponent <Rigidbody2D>();
     stickLogic           = transform.GetChild(0).GetComponent <StickLogic>();
     stickLogic.playerNum = playerNum;
     originalDrag         = rb.drag;
     joyController        = GameObject.FindObjectOfType <JoyController>();
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Awake()
 {
     gameController  = FindObjectOfType <GameController>();
     players         = FindObjectsOfType <PlayerController>();
     startPositions  = GameObject.Find("TitlePositions");
     titleScreen     = GameObject.Find("TitleScreen");
     teamController1 = GameObject.Find("TeamController1").GetComponent <TeamController>();
     teamController2 = GameObject.Find("TeamController2").GetComponent <TeamController>();
     puck            = GameObject.Find("puck");
     valueObject     = GameObject.Find("Values").transform;
     cursor          = GameObject.Find("Cursor").transform;
     playerPressed   = new bool[] { false, false, false, false };
     playerHoldTime  = new float[] { 0, 0, 0, 0 };
     valueAdditions  = new float[] { 1, 10, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f };
     valueFactors    = new float[] { 3, 60, 0.5f, 2000, 1, 500, 1.1f, 1, 0.5f, 0.3f, 1 };
     joyController   = FindObjectOfType <JoyController>();
     SetDefaults();
     UpdateValues(1);
 }