public addMonkey ( CMonkey newMonkey ) : void | ||
newMonkey | CMonkey | |
Résultat | void |
/* * =========================================================================================================== * UNITY'S STUFF * =========================================================================================================== */ /// <summary> /// When the script is initialized /// </summary> void Awake() { // Set the default settings for all the buildings Selectable = true; // All monkeys are selectable Movable = true; // All monkeys are movable Type = eObjType.Monkey; AIScript = gameObject.GetComponent<AstarAIFollow>(); // FSM setup eFSMCurrentState = FSMState.STATE_NULL; // Get info about the collider GetColliderInfo(); // Load the icon for this unit LoadMinimapIcon(); // Starts the object variables, like the sweet spot and the main mesh object GetSweetSpotAndMeshObject(); // Get the capture spot if(monkeyClass == eMonkeyType.Cientist) { captureSpot = GetCaptureSpot(); captureRaySpot = GetCaptureRaySpot(); } // Get's the spot where we will test for collisions used in the attack attackSpot = GetAttackSpot(); GUIScript = GameObject.Find("HUD-Objects").GetComponent<GUIControl>(); GUIScript.addMonkey(this); fTimeToStartMonkey = Random.value * 10; if(meshObject) { // Calculates the walk cycle half length fDustTimeOfAStep = meshObject.animation[stAnimWalk].clip.length / 2; // DEBUG //Debug.Log(this.transform + " Length: " + fDustTimeOfAStep); } }