protected override void Update() { if (!Effect) { return; } base.Update(); if (mOneJump.GetVelocity().y == 0) { Stop(); } }
/// <summary> /// Pick the item up. /// </summary> /// <param name="other"></param> public void Pick(Collider other) { if (!mCanPick) { return; } JCS_OneJump joj = this.GetComponent <JCS_OneJump>(); if (joj != null) { // Only when item is on the ground! if (joj.GetVelocity().y != 0) { return; } } JCS_Player p = other.GetComponent <JCS_Player>(); if (mAutoPickColliderTouched && p != null) { DoPick(other); return; } if (mMustBeActivePlayer) { // Check the colliding object are is active player. if (JCS_PlayerManager.instance.IsActivePlayerTransform(other.transform)) { DoPick(other); } } else { DoPick(other); } }