void Update() { if (Input.GetButtonDown("Aux Fire")) { if (currentState == TeleportState.HIT_ENEMY && teletransportTarget == null) { currentState = TeleportState.NONE; } Debug.Log("Fire"); if (currentState == TeleportState.HIT_ENEMY) { teletransportTarget.transform.position = transform.position; currentState = TeleportState.NONE; Destroy(this.gameObject); } else if (currentState == TeleportState.SECOND_SHOT_ENEMY) { Debug.Log("enemy teleporting"); } else if (currentState == TeleportState.NONE && weeb.IsGrounded()) { weeb.transform.position = transform.position; weeb.GetComponent <WeebPlayer>().ResetGravity(); Destroy(this.gameObject); } } }
void Awake() { mAnimator = transform.parent.GetComponent <Animator>(); mWeeb = transform.parent.GetComponent <WeebPlayer>(); playerSpriteRenderer = mWeeb.GetComponent <SpriteRenderer>(); mBusterSound = GetComponent <AudioSource>(); InitColorSwapTex(); PlayerUpgradeManager.Instance.InitManager(); }