void Start() { // mapping varibles Player = GameObject.Find("Player"); cammanagement = GameObject.Find("Scripts").GetComponent <CameraManagement>(); playermasterscript = GameObject.Find("Scripts").GetComponent <PlayerMasterScript>(); ingametext = GameObject.Find("Scripts").GetComponent <InGameText>(); LevelSelectHolder = GameObject.Find("LevelSelectHolder"); TimeLines = GameObject.Find("Scripts").GetComponent <TimeLineManagers>(); globalscripts = GameObject.Find("Scripts").GetComponent <GlobalScipts>(); Door = this.transform.Find("Door").gameObject; }
// Releases the Lock to the locked Unit after its ordering process is finished, so other Units can get Focus again.... // must be called by the Unit whitch has Locked the Focus,givin its own gameObject as parameter for UnlockKey, or the Focus wont be Unlocked... public bool Unlock(GameObject unlockKey) { if (IsLocked) { if (unlockKey.GetInstanceID() == KeyObject.GetInstanceID()) { KeyObject = null; InGameText.AddTextLine("FOCUS UNLOCKED !!!"); } } return(!IsLocked); }
public void OnTextNameChange(string oldName, string newName) { var inGameText = InGameText.GetInstance(); if (inGameText) { var textData = inGameText.GetTextData(newName); if (textData != null) { id = textData.id; EditorUtility.SetDirty(this.gameObject); } } }
public void OnIdChange(int oldId, int newId) { var inGameText = InGameText.GetInstance(); if (inGameText) { var textData = inGameText.GetTextData(newId); if (textData != null) { textName = textData.name; EditorUtility.SetDirty(this.gameObject); } } }
// Locks the Focus to This Actual Focussed Unit, till it is has finished recieving orders,so no other Units Will recive MouseData untill // the complete ordering process is recognized... should be called by the Unit right after an option on the RightclickPopUp has been Clicked public bool Lock() { if ((!IsLocked) || (IsLockedToThis)) { KeyObject = this.gameObject; InGameText.AddTextLine("FOCUS HAS LOCKED to: " + KeyObject.name + " " + KeyObject.GetInstanceID().ToString()); return(true); } else { return(false); } }
public void GroupedLeftOnGround() { Vector3 click = MouseEvents.State.Position.AsWorldPointOnMap; MemberUnit[0].GetComponent <UnitScript>().Options.FocussedLeftOnGround(click); for (int i = 1; i < MemberUnit.Count; i++) { Vector3 distanceVector; // float distance = Vector3.Distance(MemberUnit[i].transform.position , MemberUnit[0].transform.position); distanceVector = MemberUnit[i].transform.position - MemberUnit[0].transform.position; InGameText.AddTextLine(distanceVector.ToString()); // distanceVector = (distance>15)? distanceVector*0.66f : (distance<15)? distanceVector*2f : distanceVector; MemberUnit[i].GetComponent <UnitScript>().Options.FocussedLeftOnGround(click + distanceVector); } // MemberUnit[i].GetComponent<UnitOptions>().MoveAsGroup(MemberUnit[0]); GroupState = GROUPSTATE.Moving; }
public DropdownList <string> GetTextName() { var result = new DropdownList <string>(); var inGameText = InGameText.GetInstance(); if (inGameText) { var textList = inGameText.GetTextList(); foreach (var text in textList.texts) { result.Add(text.name, text.name); } } else { LogHelper.LogWarning("Missing In Game Text instance for Text Localization"); } return(result); }
private void NotEnoughResourcesMessage() { InGameText.AddTextLine("You need more Resources"); }
void WriteTextOnScreen(InGameText where, string msg) { gameTexts[(int)where].text = msg; }
public void LoadText() { LogHelper.Log("Loading new Text for " + this); this.text.text = InGameText.GetInstance().GetTextData(id).content; EditorUtility.SetDirty(this.gameObject); }