// Start is called before the first frame update void Start() { //cache rigidbody at the start of the game p_rigidbody = GetComponent <Rigidbody2D>(); dashScript = GetComponent <DashScript>(); animator = GetComponent <Animator>(); }
void Update() { if (player == null) { player = GameObject.FindGameObjectWithTag("Player"); playerScript = player.GetComponent <PlayerControl>(); dashScript = player.GetComponent <DashScript>(); shootScript = player.GetComponent <PlayerGun>(); } if (Input.GetKeyDown(KeyCode.C)) // fix this to implement on collider { if (paused == true) { Resume(); playerScript.enabled = true; dashScript.enabled = true; shootScript.enabled = true; } else { Pause(); playerScript.enabled = false; dashScript.enabled = false; shootScript.enabled = false; } } }
// Use this for initialization void Start() { myRigidbody = GetComponent <Rigidbody2D> (); anim = GetComponent <Animator>(); dashScript = GetComponent <DashScript>(); gunScript = GetComponent <PlayerGun>(); }
void Start() { dashScript = GetComponent <DashScript>(); spriteRenderer = GetComponent <SpriteRenderer>(); rb = GetComponent <Rigidbody2D>(); script = GetComponent <PlayerControl>(); }
private void Start() { compilerstatus.SetActive(false); player = GameObject.FindGameObjectWithTag("Player"); playerScript = player.GetComponent <PlayerControl>(); dashScript = player.GetComponent <DashScript>(); shootScript = player.GetComponent <PlayerGun>(); }
// Start is called before the first frame update void Start() { p_rigidbody = GetComponent <Rigidbody2D>(); playerstate = GetComponent <PlayerState>(); dashScript = GetComponent <DashScript>(); initialGravityScale = p_rigidbody.gravityScale; initialDrag = p_rigidbody.drag; }
void Start() { animator = GetComponent <Animator>(); p_rigidbody = GetComponent <Rigidbody2D>(); playerstate = GetComponent <PlayerState>(); dashScript = GetComponent <DashScript>(); initialGravityScale = p_rigidbody.gravityScale; tempTimeToWaitBeforeSliding = timeToWaitBeforeSliding; temptimeToIgnoreDecelerationForWallJump = timeToIgnoreDecelerationForWallJump; temptimeToUnstick = timeToUnstick; }
private void Start() { codeBlockPanel = GameObject.FindGameObjectWithTag("CodeBlocks"); solutionPanel = GameObject.FindGameObjectWithTag("SolutionBlocks"); outputText = GameObject.Find("OutputText").GetComponent <Text>(); popUpText = transform.GetChild(1).gameObject.GetComponent <Text>(); popUpText.enabled = false; screen = transform.GetChild(0).gameObject; screen.SetActive(false); player = GameObject.FindGameObjectWithTag("Player"); playerScript = player.GetComponent <PlayerControl>(); dashScript = player.GetComponent <DashScript>(); shootScript = player.GetComponent <PlayerGun>(); }
public void OpenCompiler() { if (player == null) { player = GameObject.FindGameObjectWithTag("Player"); playerScript = player.GetComponent <PlayerControl>(); dashScript = player.GetComponent <DashScript>(); shootScript = player.GetComponent <PlayerGun>(); } if (paused == true) { popUpText.GetComponent <Text>().enabled = true; Resume(); playerScript.enabled = true; } else { popUpText.GetComponent <Text>().enabled = false; Pause(); playerScript.enabled = false; } }
// Use this for initialization void Start() { dashScript = GameObject.FindGameObjectWithTag("Player").GetComponent <DashScript>(); }