public static void ShowAlert(string Msg, GM.Utilities.Types.MessageType msgType, Form CallForm) { DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo(Application.ProductName, Msg); switch (msgType) { case GM.Utilities.Types.MessageType.Success: info.Image = GM.Properties.Resources.done; break; case GM.Utilities.Types.MessageType.Error: info.Image = GM.Properties.Resources.error; break; case GM.Utilities.Types.MessageType.Info: info.Image = GM.Properties.Resources.info; break; case GM.Utilities.Types.MessageType.Debug: info.Image = GM.Properties.Resources.info; break; case GM.Utilities.Types.MessageType.Fatal: info.Image = GM.Properties.Resources.error; break; case GM.Utilities.Types.MessageType.Warn: info.Image = GM.Properties.Resources.info; break; default: break; } Alert.Show(CallForm, info); }
void Start() { gm = GameObject.Find("Main Camera").GetComponent<GM>(); player = GameObject.Find("Allie").GetComponent<Player>(); talkbox = GameObject.Find("Hunter2/TalkBox"); talkbox.SetActive(false); }
// Use this for initialization void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy (gameObject); }
void Awake() { if (current == null) current = this; else if(current != this) Destroy (gameObject); score = originalLife; }
// Use this for initialization void Start () { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } Setup(); }
// Use this for initialization void Start() { if (instance == null) //make sure only 1 instance instance = this; else if (instance != null) Destroy(gameObject); Setup(); }
// Use this for initialization void Start() { if (instance == null) instance = this; else if (instance != this) Destroy (gameObject); Setup(); }
// Use this for initialization void Start() { if (instance == null) instance = this; //else if (instance != this) //Destroy(gameOject); Setup(); }
void Awake () { //enforce Singleton pattern if (instance == null) //check if we have a GM yet instance = this; //if not, then we set to this else if (instance != this) //GM already exists Destroy (gameObject); //want to get rid of that GM, good habit to get into this! do not end up with two copies of GM Setup (); }
// Use this for initialization void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy (gameObject); Setup(); movementDirection = Vector3.left; }
void Awake() { if (master == null) { master = this; } for (int i = 0; i < arr.Length; i++) { if (arr[i] == null) throw new MissingComponentException("there is null element in arr: " + gameObject.name + " at index: " + i); arr[i].SetActive(false); } playButton.GetComponent<Button>().onClick.AddListener(() => NewGame()); }
/// <summary> /// Awake (Unity) function /// This is called FIRST, you may have to increase priority to load this in the Script /// Execution Order (already done in template project). Below are goals of this function: /// * Verify attached files to game Manager for referencing other managers /// other sort of information from outside the particular script you are in. /// * Identify and store the current device / OS that the game is running on and store it. /// * Update Scene To Load Next, This is used for development to quickly change the first scene when you hit play. /// * If this is not Unity Editor make sure levelEditMode is false, to avoid problems where wrong states are called (like input processing sent to levelEditor) /// </summary> protected override void Awake() { Debug.Log("GM_Awake()"); gameManager = GetComponent<GM>() as GM; //if (useAtlas) setAtlas(); if (scene == null) scene = GameObject.FindGameObjectWithTag("_SM").GetComponent<sceneManager>(); #if UNITY_EDITOR if (scene.thisScene != currentScene) { currentScene = scene.thisScene; } if (scene.debugOn) { framework.gMode = (int)GameMode.Slots; } #else //levelMan.levelEditMode = false; #endif DontDestroyOnLoad(this.gameObject); base.Awake(); // Call Parent Awake }
void Start() { gameData = (GameData)Resources.Load("GameData", typeof(GameData)); gm = GameObject.Find("GameManager").GetComponent<GM>(); //procClock = this.transform.GetComponentInChildren<Image> (); propertyImage = procClock; //procText = this.transform.FindChild("ProcessTime").gameObject.GetComponent<Text>(); //desText = this.transform.FindChild("DestroyClock").gameObject.GetComponent<Text> (); gold = this.transform.Find("Gold").GetComponent<Text>(); LoadCardInfo(); }
public void Awake() { Instance = this; }
void Start() { GM = GameObject.FindGameObjectWithTag("GM"); _gm = GM.GetComponent<GM>(); }
public void Start() { this.GM = GameObject.Find("GM").GetComponent<GM>(); this.EF = GameObject.Find("Effect Manager").GetComponent<EffectManager>(); }
void Start() { this.gm = GameObject.Find("GM").GetComponent<GM>(); this.effectMap = new Dictionary<Effect, spellDelegate>(); this.effectMap.Add(Effect.Fireball, new spellDelegate(Fireball)); this.effectMap.Add(Effect.Heal, new spellDelegate(Heal)); this.effectMap.Add(Effect.Firestorm, new spellDelegate(Firestorm)); this.effectMap.Add(Effect.Draw, new spellDelegate(Draw)); }
void Start() { gm = GameObject.Find("GameManager").GetComponent<GM>(); }
IEnumerator wait() { yield return(new WaitForSeconds(1f)); GM.ReloadScene(); }
void Start() { gm = GameObject.Find("GameManager").GetComponent<GM>(); gameData = (GameData)Resources.Load("GameData", typeof(GameData)); }
protected virtual void Awake() { rigidBody = GetComponent<Rigidbody>() as Rigidbody; navMeshAgent = GetComponent<NavMeshAgent> () as NavMeshAgent; willRendered = GetComponent<WillRendered> () as WillRendered; Skeleton = GetComponent<SkeletonRenderer> () as SkeletonRenderer; Render = GetComponent<Renderer> () as Renderer; EState = EffectState.DEFAULT; _gm = GM.Create(); _flip = -1; isAttack = false; isGrounded = true; _maxHP = hp;//@todo if (!IsPlayer ()) { navMeshAgent.updateRotation = updateRotation; navMeshAgent.enabled = false; } }
//God cares not for As, he cares only for your faith public void Start() { gm = GameObject.Find("GM").GetComponent<GM>(); }
void Start() { gameManager = GameObject.FindWithTag("GameController").GetComponent<GM>() as GM; }
// Use this for initialization void Start() { if (instance == null) { instance = this; } else { Destroy(instance); } Setup (); }
private void CreateBuildings(JSONObject mapData, Vector2 worldCenter) { //filter to just polygons foreach (var geo in mapData["features"].list.Where(x => x["geometry"]["type"].str == "Polygon")) { //convert and add points var geocenterx = new List <float> (); var geocentery = new List <float> (); var l = new List <Vector3>(); for (int i = 0; i < geo["geometry"]["coordinates"][0].list.Count - 1; i++) { var c = geo["geometry"]["coordinates"][0].list[i]; geocenterx.Add(c [1].f); geocentery.Add(c [0].f); var bm = GM.LatLonToMeters(c[1].f, c[0].f); //c[1].f====>33 var pm = new Vector2(bm.x - Rect.center.x, bm.y - Rect.center.y); l.Add(pm.ToVector3xz()); } try { var center = l.Aggregate((acc, cur) => acc + cur) / l.Count; float centerx = geocenterx.Sum() / geocenterx.Count; float centery = geocentery.Sum() / geocentery.Count; if (!BuildingDictionary.ContainsKey(center)) { var bh = new BuildingHolder(center, l); for (int i = 0; i < l.Count; i++) { l[i] = l[i] - bh.Center; } BuildingDictionary.Add(center, bh); var m = bh.CreateModel(); if (geo["properties"]["name"] != null) { m.name = geo["properties"]["name"].ToString().Split('"')[1]; } else { m.name = "Unknown_Building"; } var st = m.gameObject.AddComponent <Storage>(); st.lat = centerx; st.lng = centery; //Debug.Log(m.name + " --- [" +centerx +"," + centery +"]"); if (geo["properties"]["height"] != null) { float heighttemp = float.Parse(geo["properties"]["height"].ToString()); m.transform.localScale = new Vector3(1, heighttemp / 16, 1); } m.transform.parent = this.transform; center = new Vector3(center.x, center.y, center.z); m.transform.localPosition = center; m.AddComponent <MeshCollider>(); m.tag = "Collider"; if (geo["properties"]["addr_housenumber"] != null) { st.adress = (geo["properties"]["addr_housenumber"].ToString().Split('\"')[1] + " " + geo["properties"]["addr_street"].ToString().Split('\"')[1]); } //check // Collider[] hitC = Physics.OverlapSphere (m.transform.position, 30); // for(int i = 0; i < hitC.Length;i++){ // if(hitC[i].name != "Plane"){ // GameObject.Destroy(m); // break; // }else{ // Debug.Log(hitC[i].name); // } // } } } catch (Exception ex) { //Debug.Log(ex); } } }