// Start is called before the first frame update void Start() { mCurrCaptureIndex = -1; mCurrReviewIndex = -1; mSpR = this.transform.Find("Screen").GetComponent <SpriteRenderer>(); mScreenWidth = mSpR.sprite.texture.width; mScreenHeight = mSpR.sprite.texture.height; //mSpR.sprite = mSpBackGournd; //mSpriteSize = new Vector2( // mSpR.transform.localScale.x * mSpR.sprite.textureRect.width / mSpR.sprite.pixelsPerUnit, // mSpR.transform.localScale.y * mSpR.sprite.textureRect.height / mSpR.sprite.pixelsPerUnit // ); GameObject[] rootGameObjects = SceneManager.GetActiveScene().GetRootGameObjects(); foreach (var rootGameObject in rootGameObjects) { ICapturable[] childrenInterfaces = rootGameObject.GetComponentsInChildren <ICapturable>(true); foreach (var childInterface in childrenInterfaces) { mCapturable.Add(childInterface); } } mItemsBox = FindObjectOfType <ItemsBox>(); mSceneCtrl = FindObjectOfType <SceneCtrl>(); }
public void check(List <int> act) { string scene = ll.getSceneName(); sc = GameObject.Find("SceneCtrl").GetComponent <SceneCtrl>(); if (!ans.ContainsKey(scene)) { print(scene); ans.Add(scene, new List <List <int> >() { act }); sc.NewWin(); return; } foreach (List <int> l in ans[scene]) { if (l.SequenceEqual(act)) { sc.Win(); return; } } ans[scene].Add(act.ToList()); sc.NewWin(); }
public void LoadingScene() { if (m_cSceneCtrl != null) { m_cSceneCtrl.SceneRelease(); m_cSceneCtrl = null; } switch (m_NextScene) { case SCENE.MAIN: StartCoroutine(coLoadScene("Main")); break; case SCENE.SELECT: StartCoroutine(coLoadScene("Select")); break; case SCENE.BATTLE1: m_cSceneCtrl = new BattleSceneCtrl(); m_cSceneCtrl.SceneInit(m_BOSSScene); StartCoroutine(coLoadScene("Battle")); break; } }
void Awake() { if (instance == null) { instance = this; } }
// Use this for initialization private void Awake() { context = this; if (Elephant == null) { Elephant = GameObject.Find("Elephant").GetComponent <ElephantCtrl>(); } }
public static SceneCtrl instance; // to create a singleton private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } DontDestroyOnLoad(this); }
void Awake() { if (_instance != null) { Destroy(_instance); } _instance = this; _InitLayer(); if (OnSceneLoaded != null) { OnSceneLoaded(); } }
// Start is called before the first frame update void Start() { sceneCtrl = FindObjectOfType <SceneCtrl>(); }
void Start() { sc = GameObject.Find("SceneCtrl").GetComponent <SceneCtrl>(); }