private void Awake() { FarmRoot.instance = this; string path = "Farm/Builds/SettingMark/SettingMark"; GameObject gameObject = AssetDataMng.Instance().LoadObject(path, null, true) as GameObject; if (null == gameObject) { return; } GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject); gameObject2.transform.parent = base.transform; gameObject2.transform.localScale = Vector3.one; gameObject2.transform.localPosition = Vector3.zero; gameObject2.transform.localEulerAngles = Vector3.zero; this.settingMark = gameObject2.GetComponent <FarmSettingMark>(); path = "Farm/Builds/SelectMark/SelectMark"; gameObject = (AssetDataMng.Instance().LoadObject(path, null, true) as GameObject); if (null == gameObject) { return; } gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject); gameObject2.transform.parent = base.transform; gameObject2.transform.localScale = Vector3.one; gameObject2.transform.localPosition = Vector3.zero; gameObject2.transform.localEulerAngles = Vector3.zero; this.selectMark = gameObject2.GetComponent <FarmSelectMark>(); gameObject2.SetActive(false); FarmCameraControlForCMD.ClearCount(); }
public void SetSelectMark(FarmField farmField, FarmSelectMark mark) { mark.gameObject.SetActive(true); mark.SetParent(base.gameObject); Vector2 gridSize = new Vector2(farmField.gridHorizontal, farmField.gridVertical); mark.SetSize(this.sizeX, this.sizeY, gridSize); }