Esempio n. 1
0
    // 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>();
    }
Esempio n. 2
0
    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();
    }
Esempio n. 3
0
    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;
        }
    }
Esempio n. 4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 5
0
 // 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);
    }
Esempio n. 7
0
    void Awake()
    {
        if (_instance != null)
        {
            Destroy(_instance);
        }
        _instance = this;

        _InitLayer();

        if (OnSceneLoaded != null)
        {
            OnSceneLoaded();
        }
    }
Esempio n. 8
0
 // Start is called before the first frame update
 void Start()
 {
     sceneCtrl = FindObjectOfType <SceneCtrl>();
 }
Esempio n. 9
0
 void Start()
 {
     sc = GameObject.Find("SceneCtrl").GetComponent <SceneCtrl>();
 }