public void AnimationFinish() { canDeflect = false; //We see if we are eligable for taxing the bot once the animation is finished. if (activationTax) { //When this function gets called we also add the activation heat tax. host.AddHeat(ActivationHeat); //Play the effect if (ShieldActivationEffect) { //ShieldActivationEffect.transform.position = host.transform.position; ShieldActivationEffect.Play(); } if (ActivationTaxSound) { AudioPlayer.GetPlayer().PlaySound(ActivationTaxSound); } } //If we havent shattered anything then we can play the empty shatter animation. if (!Host.DidShatter) { //reset the variable. Host.DidShatter = true; Host.EmptyShatterEffect.Play(); GameObjectTracker.instance.EmptyShatter(); } }
void OnTriggerStay(Collider col) { //Check if we collide with a CommandCenter. if (col.gameObject.CompareTag("Bot")) { Bot b = col.gameObject.GetComponent <Bot>(); // if we touch the command Center add health, // but only certain amount per second if (b && (isAffective && (Time.time - timeStartedGivingHealth) > healthGivingFreq)) { // TODO: for now, we are going to add negative damage, should work b.AddHeat(-healthToGive); //Send the message. GameObjectTracker.instance.CoolDownBot(healthToGive); // print("Giving +" + healthToGive + " to Player!"); timeStartedGivingHealth = Time.time; } } } //All Collisions Check
//Controls for development. public void TestControls() { //if(Application.isEditor || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.WindowsPlayer) if (true) { //We will just add on a bit of heat as we press the H button if (Input.GetKey(KeyCode.H)) { //Bot_01.Damage(55.0f); CommandCenter_01.Damage(55.0f); } if (Input.GetKeyDown(KeyCode.M)) { //GameObjectTracker.instance._PlayerData.GemBank += 1000; ActivityManager.Instance.FadeToBlack(); } //We will just add on a bit of heat as we press the H button if (Input.GetKey(KeyCode.C)) { Bot_01.Cool(50.0f); } if (Input.GetKeyDown(KeyCode.P)) { foreach (string s in Input.GetJoystickNames()) { print(s); } } if (Input.GetKeyDown(KeyCode.Alpha1)) { ClearFreeCannons(); } if (Input.GetKeyDown(KeyCode.Alpha0)) { AssignCannonSlotTypes(); } if (Input.GetButtonDown("Shoot")) { Bot_01.Shoot(); //AnimateAttack(); } if (Input.GetButtonDown("OverHeat")) { Bot_01.AddHeat(1000.0f); } if (Input.GetButtonDown("Shield") || Input.GetKeyDown(KeyCode.B)) { Bot_01.ActivateDefense(); } if (Input.GetButtonUp("Shield") || Input.GetKeyUp(KeyCode.B)) { Bot_01.DeactivateDefense(); } //Absolute Input controls for testing purposes if (Input.GetAxis("Horizontal") < 0.0f || Input.GetKeyDown(KeyCode.A)) { movingDirection += -(Vector3.right) * -Input.GetAxis("Horizontal"); } if (Input.GetAxis("Horizontal") > 0.0f || Input.GetKeyDown(KeyCode.D)) { movingDirection += (Vector3.right) * Input.GetAxis("Horizontal"); ; } if (Input.GetAxis("Vertical") > 0.0f || Input.GetKeyDown(KeyCode.W)) { movingDirection += (Vector3.forward) * Input.GetAxis("Vertical"); } if (Input.GetAxis("Vertical") < 0.0f || Input.GetKeyDown(KeyCode.S)) { movingDirection += -(Vector3.forward) * -Input.GetAxis("Vertical"); } } //movingDirection.Normalize(); }