void Awake() { timeLastEnemyHitted = Time.time; trigger = GetComponentInChildren <BoxCollider>(); sprite = transform.GetComponentInChildren <SpriteRenderer>(); glitchPartPool = new ObjectPool(glitchPart); lives = 3; items = 0; //Instantiate the glitch fragments to avoid lag later in the game GameObject[] parts = new GameObject[100]; for (int i = 0; i < 100; i++) { parts[i] = glitchPartPool.getObject(); } for (int i = 0; i < 100; i++) { parts[i].SetActive(false); } boxUIActivatedRectTransform = boxUIActivated.GetComponent <RectTransform>(); exclamationSize = boxUIActivatedRectTransform.sizeDelta; boxUIActivated.SetActive(false); guiRectTrans = gui.GetComponent <RectTransform>(); slowFPSScript = transform.FindChild("Powers").GetComponentInChildren <SlowFPS>(); }
void Awake() { timeLastEnemyHitted = Time.time; trigger = GetComponentInChildren<BoxCollider>(); sprite = transform.GetComponentInChildren<SpriteRenderer>(); glitchPartPool = new ObjectPool(glitchPart); lives = 3; items = 0; //Instantiate the glitch fragments to avoid lag later in the game GameObject[] parts = new GameObject[100]; for (int i = 0; i < 100; i++) { parts[i] = glitchPartPool.getObject(); } for (int i = 0; i < 100; i++) { parts[i].SetActive(false); } boxUIActivatedRectTransform = boxUIActivated.GetComponent<RectTransform>(); exclamationSize = boxUIActivatedRectTransform.sizeDelta; boxUIActivated.SetActive(false); guiRectTrans = gui.GetComponent<RectTransform>(); slowFPSScript = transform.FindChild("Powers").GetComponentInChildren<SlowFPS>(); }
void Start() { allowMovement = true; spriteRenderer = transform.GetComponentInChildren <SpriteRenderer>(); plAnimation = transform.GetComponentInChildren <Animator>(); glitchParticles = transform.FindChild("GlitchParticles").GetComponent <ParticleSystem>(); jumpParticles = transform.FindChild("JumpParticles").GetComponent <ParticleSystem>(); dustParticles = transform.FindChild("DustParticles").GetComponent <ParticleSystem>(); teleport = transform.FindChild("Powers/Teleport").GetComponent <TeleportScript>(); slowFPS = transform.FindChild("Powers/SlowFPS").GetComponent <SlowFPS>(); state = player_state.IN_GROUND; }
void Start() { allowMovement = true; spriteRenderer = transform.GetComponentInChildren<SpriteRenderer>(); plAnimation = transform.GetComponentInChildren<Animator>(); glitchParticles = transform.FindChild("GlitchParticles").GetComponent<ParticleSystem>(); jumpParticles = transform.FindChild("JumpParticles").GetComponent<ParticleSystem>(); dustParticles = transform.FindChild("DustParticles").GetComponent<ParticleSystem>(); teleport = transform.FindChild("Powers/Teleport").GetComponent<TeleportScript>(); slowFPS = transform.FindChild("Powers/SlowFPS").GetComponent<SlowFPS>(); state = player_state.IN_GROUND; }