void Start() { Gctrl = GameObject.Find("GameCtrl").GetComponent <GameCtrl>(); Bctrl = GameObject.Find("BackGroundCtrl").GetComponent <BackGroundCtrl>(); renderer = GetComponent <Renderer>(); renderer.sortingLayerName = "BackGround"; speed = Random.Range(0.05f, 0.1f); }
private void Start() { rd2 = GetComponent <Rigidbody2D>(); isSet = false; init = true; Gctrl = GameObject.Find("GameCtrl").GetComponent <GameCtrl>(); CM = GameObject.Find("Pos").GetComponent <CanMove>(); gameObject.GetComponent <SpriteRenderer>().sortingOrder = Gctrl.layer; Bctrl = GameObject.Find("BackGroundCtrl").GetComponent <BackGroundCtrl>(); Uctrl = GameObject.Find("EventSystem").GetComponent <UICtrl>(); if (Gctrl.isFeverTime == true) { StartCoroutine(FeverCoroutine()); } }
public void init() { windowStack = new Stack <WindowBase> (); MonoBase.Create3Dobj("NGUI").obj.name = "NGUI"; MonoBase.Create3Dobj("Base/NGUI_manager").obj.name = "NGUI_manager"; NGUIroot = GameObject.Find("NGUI_manager").GetComponent <UIRoot> (); MonoBase.DontDestroyOnLoad(NGUIroot.gameObject); UIScaleRoot = GameObject.Find("/NGUI_manager/GameCamera/UIScaleRoot").gameObject; UIEffectRoot = GameObject.Find("/NGUI_manager/GameCamera/UIScaleRoot/UIEffectRoot").gameObject; gameCamera = GameObject.Find("/NGUI_manager/GameCamera").GetComponent <Camera> (); windowList = new BetterList <WindowBase> (); maskWindow = UIScaleRoot.transform.FindChild("maskWindow").gameObject.GetComponent <MaskWindow> (); MonoBase.Create3Dobj("Effect/Other/3D_background").obj.name = "3D_background"; backGround = GameObject.Find("3D_background").gameObject.GetComponent <BackGroundCtrl> (); GameManager.Instance.StartCoroutine(screenRote()); Time.timeScale = GameManager.Instance.gameSpeed; Debug.Log("Ui init"); }