// Start is called before the first frame update void Start() { facingRight = true; myRigidBody = GetComponent <Rigidbody2D>(); myAnimator = GetComponent <Animator>(); myBodyCollider = GetComponent <CapsuleCollider2D>(); myFeet = GetComponent <CircleCollider2D>(); myjoystick = FindObjectOfType <Joystick>(); myjumpbutton = FindObjectOfType <JumpButton>(); switchPlayerButton = FindObjectOfType <SwitchPlayerButton>(); myattackbutton = FindObjectOfType <AttackButton>(); mygrabbutton = FindObjectOfType <GrabButton>(); }
// Start is called before the first frame update void Start() { if (!multiplayer) { facingRight = true; myRigidBody = GetComponent <Rigidbody2D>(); myAnimator = GetComponent <Animator>(); myBodyCollider = GetComponent <CapsuleCollider2D>(); myFeet = GetComponent <CircleCollider2D>(); myjoystick = GameObject.Find("Fixed Joystick").GetComponent <Joystick>(); myjumpbutton = GameObject.Find("JumpButton").GetComponent <JumpButton>(); switchPlayerButton = GameObject.Find("SwitchPlayerButton").GetComponent <SwitchPlayerButton>(); myattackbutton = FindObjectOfType <AttackButton>(); //mygrabbutton = FindObjectOfType<GrabButton>(); weaponjoystick = GameObject.Find("Fixed Joystick 2").GetComponent <FixedJoystick>(); } }