How do I fix this warning sign that keeps popping up in Unity.
My code is
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Fighter_Player : MonoBehaviour {
public enum PlayerType
{
HUMAN, AI
}
public static float MAX_HEALTH = 100F;
public float healt = MAX_HEALTH;
public string fighterName;
public Fighter_Player oponent;
public PlayerType player;
protected Animator Player;
private Rigidbody myBody;
// Use this for initialization
void Start () {
myBody = GetComponent<Rigidbody> ();
Player = GetComponent<Animator> ();
}
public void UpdateHumanInput () {
if (Input.GetAxis ("Horizontal") > 0.1) {
Player.SetBool ("Walk_Forward", true);
} else {
Player.SetBool ("Walk_Forward", false);
}
if (Input.GetAxis ("Horizontal") < -0.1) {
Player.SetBool ("Walk_Backward", true);
} else {
Player.SetBool ("Walk_Backward", false);
}
if (Input.GetAxis ("Vertical") < -0.1) {
Player.SetBool ("Duck", true);
} else {
Player.SetBool ("Duck", false);
}
if (Input.GetKeyDown (KeyCode.F)) {
Player.SetTrigger ("Punch_Mid");
}
if (Input.GetKeyDown (KeyCode.G)) {
Player.SetTrigger ("Special_Move");
}
}
// Update is called once per frame
void Update () {
Player.SetFloat ("health", healtPercent);
if (oponent != null) {
Player.SetFloat ("oponent_health", oponent.healtPercent);
} else {
Player.SetFloat ("oponent_health", 1);
}
if (player == PlayerType.HUMAN) {
UpdateHumanInput ();
}
}
public float healtPercent {
get {
return healt / MAX_HEALTH;
}
}
public Rigidbody body {
get {
return this.myBody;
}
}
}