void OnDisable() { if (character != null) { character.Move(Vector3.zero); //When the Input is Disable make sure the character/animal is not moving. } }
// Update is called once per frame void Update() { if (aiControl) { if (target != null) { agent.SetDestination(target.position); //Debug.Log("source"); } //Debug.Log(agent.remainingDistance + " " + agent.stoppingDistance); if (agent.remainingDistance > agent.stoppingDistance) { //Debug.Log("Moving"); character.Move(agent.desiredVelocity); } else { character.Move(Vector3.zero); GetComponent <MalbersAnimations.Utilities.LookAt>().active = true; } } }
/// <summary> /// Send all the Inputs to the Animal /// </summary> protected virtual void SetInput() { if (cameraBaseInput) { character.Move(CameraInputBased()); } else { character.Move(new Vector3(h, 0, v), false); } if (isActive("Attack1")) { character.Attack1 = GetInput("Attack1"); //Get the Attack1 button } if (isActive("Attack2")) { character.Attack2 = GetInput("Attack2"); //Get the Attack1 button } if (isActive("Action")) { character.Action = GetInput("Action"); //Get the Action/Emotion button } if (isActive("Jump")) { character.Jump = GetInput("Jump"); } if (isActive("Shift")) { character.Shift = GetInput("Shift"); //Get the Shift button } if (isActive("Fly")) { character.Fly = GetInput("Fly"); //Get the Fly button } if (isActive("Down")) { character.Down = GetInput("Down"); //Get the Down button } if (isActive("Dodge")) { character.Dodge = GetInput("Dodge"); //Get the Down button } if (isActive("Stun")) { character.Stun = GetInput("Stun"); //Get the Stun button change the variable entry to manipulate how the stun works } if (isActive("Death")) { character.Death = GetInput("Death"); //Get the Death button change the variable entry to manipulate how the death works } if (isActive("Damaged")) { character.Damaged = GetInput("Damaged"); } if (isActive("Speed1")) { character.Speed1 = GetInput("Speed1"); //Walk } if (isActive("Speed2")) { character.Speed2 = GetInput("Speed2"); //Trot } if (isActive("Speed3")) { character.Speed3 = GetInput("Speed3"); //Run } //Get the Death button change the variable entry to manipulate how the death works }
/// <summary> /// Send all the Inputs to the Animal /// </summary> protected virtual void SetInput() { if (cameraBaseInput) { character.Move(CameraInputBased()); } else { character.Move(new Vector3(h, 0, v), false); } if (Attack1 != null && Attack1.active) { character.Attack1 = Attack1.GetInput; //Get the Attack1 button } if (Attack2 != null && Attack2.active) { character.Attack2 = Attack2.GetInput; //Get the Attack2 button } if (Action != null && Action.active) { character.Action = Action.GetInput; //Get the Action/Emotion button } if (Jump != null && Jump.active) { character.Jump = Jump.GetInput; //Get the Jump button } if (Shift != null && Shift.active) { character.Shift = Shift.GetInput; //Get the Shift button } if (Fly != null && Fly.active) { character.Fly = Fly.GetInput; //Get the Fly button } if (Down != null && Down.active) { character.Down = Down.GetInput; //Get the Down button } if (Dodge != null && Dodge.active) { character.Dodge = Dodge.GetInput; //Get the Dodge button } if (Stun != null && Stun.active) { character.Stun = Stun.GetInput; //Get the Stun button } if (Death != null && Death.active) { character.Death = Death.GetInput; //Get the Death button } if (Damaged != null && Damaged.active) { character.Damaged = Damaged.GetInput; //Get the Damaged button } if (Speed1 != null && Speed1.active) { character.Speed1 = Speed1.GetInput; //Get the Speed1 button } if (Speed2 != null && Speed2.active) { character.Speed2 = Speed2.GetInput; //Get the Speed2 button } if (Speed3 != null && Speed3.active) { character.Speed3 = Speed3.GetInput; //Get the Speed3 button } if (SpeedUp != null && SpeedUp.active) { character.SpeedUp = SpeedUp.GetInput; //Get the Speed3 button } if (SpeedDown != null && SpeedDown.active) { character.SpeedDown = SpeedDown.GetInput; //Get the Speed3 button } }
// Update is called once per frame void Update() { character.Move(new Vector3(h, 0, v), false); }