void Weapons() { if (Input.GetKeyUp(KeyCode.Tab)) { if (currentWeapon == WeaponModes.sword) { currentWeapon = WeaponModes.gun; } else { currentWeapon = WeaponModes.sword; } } if (Input.GetKeyDown(KeyCode.Space)) { if (currentWeapon == WeaponModes.sword) { sword(); } if (currentWeapon == WeaponModes.gun) { cannon(); } } }
// Use this for initialization void Start() { youHaveDied = false; mSpeedBonus = 1; mPlayerRotation = 0; mBaseSpeed = 60; unitVelo = Vector2.zero; currentWeapon = WeaponModes.sword; //MRtoMessWith = this.gameObject.GetComponent<MeshRenderer>(); // //Get Hit Vars Below: // hurt = false; lifeRemaining = maxLife; hurtStateTime = 2; inDamageRatio = 1f; hurtStateTimeRemaining = hurtStateTime; }