예제 #1
0
	// Use this for initialization
	void Start () {
		CharacterController = GetComponent<CharacterController> ();
		CurrentFuel = MaxFuel;
		BoostSpeed = MoveSpeed + 20;
		Slider[] sliders = GameObject.Find("Canvas").GetComponentsInChildren<Slider>();
		if (sliders.Length > 1) {
			fuelBar = sliders[1];
			fuelBar.value = 1;
		} else {
			Debug.Log("Fuel bar null");
		}

		mechCombat = GetComponent<MechCombat>();
	}
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     cc    = animator.transform.parent.gameObject.GetComponent <CharacterController>();
     mctrl = animator.transform.parent.gameObject.GetComponent <MechController>();
     mcbt  = animator.transform.parent.gameObject.GetComponent <MechCombat>();
 }
예제 #3
0
 void initComponents()
 {
     CharacterController = GetComponent <CharacterController> ();
     mechCombat          = GetComponent <MechCombat>();
     animator            = transform.Find("CurrentMech").gameObject.GetComponent <Animator>();
 }