Inheritance: MonoBehaviour
        static internal int checkDelegate(IntPtr l,int p,out SceneLoader.LoadSceneDoneCallback ua) {
            int op = extractFunction(l,p);
			if(LuaDLL.lua_isnil(l,p)) {
				ua=null;
				return op;
			}
            else if (LuaDLL.lua_isuserdata(l, p)==1)
            {
                ua = (SceneLoader.LoadSceneDoneCallback)checkObj(l, p);
                return op;
            }
            LuaDelegate ld;
            checkType(l, -1, out ld);
            if(ld.d!=null)
            {
                ua = (SceneLoader.LoadSceneDoneCallback)ld.d;
                return op;
            }
			LuaDLL.lua_pop(l,1);
			
			l = LuaState.get(l).L;
            ua = (string a1) =>
            {
                int error = pushTry(l);

				pushValue(l,a1);
				ld.pcall(1, error);
				LuaDLL.lua_settop(l, error-1);
			};
			ld.d=ua;
			return op;
		}
	void Awake()
	{
		if (instance == null)
			instance = this;
		else if (instance != this)
			Destroy (this.gameObject);
	}
    void Awake()
    {
        if (instance == null)
            instance = this;
        else if (instance != this)
            Destroy (gameObject);

        DontDestroyOnLoad (gameObject);
    }
 public void Awake()
 {
     if(instance == null)
     {
         instance = new SceneLoader();
     }
     instance = this;
     changeMenuSound = gameObject.GetComponent<AudioSource>();
 }
Example #5
0
 protected void Awake()
 {
     instance = this;
     DontDestroyOnLoad (transform.gameObject);
     foreach (GameObject go in persistentGameobjects) {
         DontDestroyOnLoad (go);
     }
     fade = gameObject.GetComponent<SceneFadeInOut> ();
 }
	void Awake(){
		if(ins == null){

			ins = this;
			GameObject.DontDestroyOnLoad(gameObject);
			GameSceneManager.ins.OwnSecne = (int)this.curSceneName;

		}else if(ins != this){

			Destroy(gameObject);
		}
	}
Example #7
0
 void Awake()
 {
     if(manager == null)           //If manager doesn't exist, create one
     {
         DontDestroyOnLoad(gameObject);
         manager = this;
     } else if(manager != null)    //if manager does exist, destroy this copy
     {
         Destroy(gameObject);
     }
     manager = this;
 }
Example #8
0
    protected void Awake()
    {
        //Make this a singleton
        Object.DontDestroyOnLoad (gameObject);
        mainController = this;

        //Store all update functions in an array of delegates.
        updateDelegates = new UpdateDelegate[(int)SceneState.Count];
        updateDelegates [(int)SceneState.Reset] = UpdateSceneReset;
        updateDelegates [(int)SceneState.Preload] = UpdateScenePreload;
        updateDelegates [(int)SceneState.Load] = UpdateSceneLoad;
        updateDelegates [(int)SceneState.Unload] = UpdateSceneUnload;
        updateDelegates [(int)SceneState.Postload] = UpdateScenePostload;
        updateDelegates [(int)SceneState.Ready] = UpdateSceneReady;
        updateDelegates [(int)SceneState.Run] = UpdateSceneRun;

        nextSceneName = defaultSceneName;
        sceneState = SceneState.Reset;
    }
Example #9
0
 public void LoadMenu()
 {
     SceneLoader.LoadLevel("Menu");
 }
Example #10
0
        public BaseRayEngine() {
            frameParsers = new Dictionary<Type, Action<IFrameElement>>();
            frameParsers.Add(typeof(FrameCamera), cameraItem =>
            {
                var item = (FrameCamera)cameraItem;
                Camera = new BasicPerspectiveCamera(item.Position, item.Target, item.Up, width, height) { Fov = 60 };
            });

            frameParsers.Add(typeof(FrameObjFileReference), item =>
            {
                var objFileRef = (FrameObjFileReference)item;
                var loader = new GlobalIndexObjLoader();
                scene = loader.Load(objFileRef.ObjFilePath);
                var mload = new MaterialLoader();
                mats = mload.LoadMaterials(objFileRef.MtlFilePath);

                foreach (var materialInfo in mats) {
                    if (materialInfo.Name.ToLower().Contains("glass") ||
                         materialInfo.Name.ToLower().Contains("wire_134006006")
                         ) {
                        materialInfo.Kt = materialInfo.Kd;
                        materialInfo.Kd = RgbSpectrum.ZeroSpectrum();

                        materialInfo.MediumInfo = Glass;
                    }
                    if (materialInfo.Name.ToLower().Contains("metal")) {
                        materialInfo.Kr = materialInfo.Kd;
                    }
                }
            });


            frameParsers.Add(typeof(Frame3DsFileReference), item =>
            {
                var sceneFileRef = (Frame3DsFileReference)item;
                var loader = new SceneLoader();
                scene = loader.Load(sceneFileRef.FilePath);
                mats = loader.LoadMaterials(sceneFileRef.FilePath);

                foreach (var materialInfo in mats) {
                    if (materialInfo.Name.ToLower().Contains("glass") ||
                         materialInfo.Name.ToLower().Contains("wire_134006006")
                         ) {
                        materialInfo.Kt = materialInfo.Kd;
                        materialInfo.Kd = RgbSpectrum.ZeroSpectrum();

                        materialInfo.MediumInfo = Glass;
                    }
                    if (materialInfo.Name.ToLower().Contains("metal")) {
                        materialInfo.Kr = materialInfo.Kd;
                    }
                }
                if (scene.Cameras != null && scene.Cameras.Any()) {
                    Camera = new BasicPerspectiveCamera(scene.Cameras[0].Position, scene.Cameras[0].Direction, scene.Cameras[0].Up, width, height) { Fov = scene.Cameras[0].Fov };
                }
            });


            frameParsers.Add(typeof(FrameLightsource), item =>
            {
                if (lights == null) {
                    lights = new List<ILight>();
                }
                var lightsource = (FrameLightsource)item;
                switch (lightsource.LightType) {
                    case LightSourceTypes.Point:
                        lights.Add(new PointLight(lightsource));
                        break;
                    case LightSourceTypes.EnvironmentMap:
                        lights.Add(envMap = new InfiniteLight(lightsource));
                        break;
                    case LightSourceTypes.Area:
                        //if (AreaLightAsMeshLight)
                            lights.Add(new MeshLight(lightsource));
                        break;
                }
            });
        }
 void BacktoLobby(SocketIOEvent obj)
 {
     SceneLoader.ToScene("MenuScene");
 }
Example #12
0
 private void Start()
 {
     sceneLoader = FindObjectOfType <SceneLoader>();
 }
Example #13
0
 public Material( SceneLoader _Owner, string _Name )
     : base(_Owner, _Name)
 {
 }
 // Start is called before the first frame update
 void Start()
 {
     sceneLoaderHandle = FindObjectOfType <SceneLoader>();
 }
 private void Construct(SceneLoader sceneLoader)
 {
     _sceneLoader = sceneLoader;
 }
Example #16
0
 public void SwitchBackToMainScene()
 {
     SceneLoader.LoadMainScene();
 }
Example #17
0
 private void Start()
 {
     pindahScene = FindObjectOfType <SceneLoader>();
 }
Example #18
0
 // Start is called before the first frame update
 void Start()
 {
     Debug.Log(gameObject.name, gameObject);
     SceneLoader.LoadScene(load);
 }
Example #19
0
 private void Awake()
 {
     SceneLoader.instance = this;
 }
Example #20
0
 public void Start()
 {
     _sceneLoader = FindObjectOfType <SceneLoader>();
     _playerC     = FindObjectOfType <PlayerController>();
 }
Example #21
0
 private void Start()
 {
     loader    = GameObject.FindObjectOfType <SceneLoader>();
     lostScene = SceneManager.GetActiveScene().buildIndex;
 }
Example #22
0
 private void Awake()
 {
     SceneLoader.OnStartScene();
 }
Example #23
0
 public override void Restart()
 {
     SceneLoader.LoadSceneAsyncSingle(SceneManager.GetActiveScene().buildIndex);
 }
Example #24
0
 public Primitive( LoaderTempMesh _OwnerMesh, SceneLoader _Owner, string _Name, FBXImporter.Material _Material )
     : base(_Owner, _Name)
 {
     m_OwnerMesh = _OwnerMesh;
     m_Material = _Material;
     // 				if ( m_Material == null )
     // 					throw new Exception( "Invalid material for primitive \"" + _Name + "\"!" );
 }
Example #25
0
 public override void LoadMainMenu()
 {
     SceneLoader.LoadSceneAsyncSingle(0);
 }
Example #26
0
    public static BattleUnit Create(BattleUnitProto proto, EBattleFactionType factionType, SceneLoader loader)
    {
        GameObject go = new GameObject();
        GameMonoAgent agent = go.AddComponent<GameMonoAgent>();
        BattleUnit btUnit = agent.AddGameMonoComponent<BattleUnit>();
        btUnit.FactionType = factionType;
        btUnit.theTile = factionType == EBattleFactionType.FT_Player
            ? BattleField.instance.PlayerField.GetTile(proto.MainTileIndex)
            : BattleField.instance.EnemyField.GetTile(proto.MainTileIndex);

        btUnit.BindLoader = loader;
        btUnit.Parse(proto);

        return null;
    }
Example #27
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     Instance = this;
 }
Example #28
0
 private void Awake()
 {
     loader = GameObject.FindGameObjectWithTag("Scene").GetComponent<SceneLoader>();
     ObjectNear += ScenesJunction_ObjectNear;
 }
Example #29
0
 // Use this for initialization
 private void Awake()
 {
     sceneLoader = SceneLoader.Instance;
 }
Example #30
0
    IEnumerator Start()
    {
        baseMarkers = new List <BaseMarker>();

        sceneLoader = GameObject.Find("SceneController").GetComponent <SceneLoader>();

        for (int i = 0; i < sceneLoader.bases.Count; i++)
        {
            baseMarkers.Add(Instantiate(baseMarkerPrefab));
            baseMarkers[i].transform.parent = baseMarkerParent.transform;
            baseMarkers[i].ShowBase(sceneLoader.bases[i].lat, sceneLoader.bases[i].lon, sceneLoader.bases[i].lvl);
        }

        mapControl.ScrollToLatLon(0f, -0f);

        sceneLoader.BindMap();

        loadingPanel.gameObject.SetActive(true);

        // First, check if user has location service enabled
        if (!Input.location.isEnabledByUser)
        {
            Debug.Log("not enabled");
            yield break;
        }

        Input.compass.enabled = true;
        // Start service before querying location
        Input.location.Start(1, 1);

        // Wait until service initializes
        int maxWait = 20;

        while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0)
        {
            yield return(new WaitForSeconds(1));

            maxWait--;
            Debug.Log(maxWait);
        }

        // Service didn't initialize in 20 seconds
        if (maxWait < 1)
        {
            debugText.text = ("Timed out");
            yield break;
        }

        // Connection has failed
        if (Input.location.status == LocationServiceStatus.Failed)
        {
            debugText.text = ("Unable to determine device location");
            yield break;
        }
        else
        {
            // Access granted and location value could be retrieved
            debugText.text = ("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " + Input.location.lastData.timestamp + " " + Input.compass.enabled);
            mapControl.ScrollToLatLon(Input.location.lastData.latitude, Input.location.lastData.longitude);

            for (int i = 0; i < baseMarkers.Count; i++)
            {
                baseMarkers[i].ShowBase(sceneLoader.bases[i].lat, sceneLoader.bases[i].lon, sceneLoader.bases[i].lvl);
            }

            loadingPanel.gameObject.SetActive(false);
        }

        // Stop service if there is no need to query location updates continuously
        Input.location.Stop();
        loadingPanel.gameObject.SetActive(false);
    }
Example #31
0
        public void StartLoadScene(string sceneName)
        {
            SceneLoader loader = sceneLoader.AddComponent <SceneLoader>();

            loader.StartLoadScene(sceneName);
        }
Example #32
0
 public void LoadByName(string sceneName)
 {
     SceneLoader.LoadNextScene();
 }
Example #33
0
 public override IEnumerator InitializeEnumerator(object param)
 {
     _outGameButton.onClick.AddListener(() => SceneLoader.LoadScene("OutGame"));
     yield break;
 }
Example #34
0
 private void Awake()
 {
     _sceneLoader = GetComponent <SceneLoader>();
 }
        public LoaderTempSceneObject( SceneLoader _Owner, string _Name )
        {
            if ( _Name == null )
                throw new Exception( "Invalid name for object ! You cannot provide null as a name for an object!" );

            m_Owner = _Owner;
            m_Name = _Name;
        }
Example #36
0
 void Awake()
 {
     if(_instance == null)
         _instance = this;
 }
Example #37
0
    // Start is called before the first frame update
    //void Start()
    //{
    //
    //}
    //
    //// Update is called once per frame
    //void Update()
    //{
    //
    //}

    public void SwapScenes()
    {
        SceneLoader.SwitchScene(1);
    }
Example #38
0
 protected override bool _OnCreate(int tableid, SceneLoader loader, params object[] args)
 {
     return true;
 }
Example #39
0
 private void Awake()
 {
     instance = this;
 }
Example #40
0
        private void Construct(IStageDataUseCase stageDataUseCase, IClearDataUseCase clearDataUseCase, ISaveLanguageUseCase languageUseCase, SceneLoader sceneLoader)
        {
            for (int i = 0; i < clearDataUseCase.clearData.Length; i++)
            {
                var index     = i;
                var stageData = stageDataUseCase.GetStageData(index);
                var isClear   = clearDataUseCase.clearData[index];
                stageButtonViews[index].Init(index + 1, stageData.GetButtonTexture(isClear), () =>
                {
                    sceneLoader.LoadScene(GameType.FreePlay, SceneName.Main, LoadType.Direct, index);
                });
            }

            var freePlayClearCount = clearDataUseCase.clearData
                                     .Count(x => x);

            tweetButtonView.Init(languageUseCase, freePlayClearCount);

            // FreePlay全クリア
            var isFreePlayClear = freePlayClearCount.Equals(GameConfig.FREE_PLAY_COUNT);

            red.SetActive(isFreePlayClear);

            // ScoreAttack全クリア
            var isScoreAttackClear = clearDataUseCase.rankData
                                     .Count(x => x)
                                     .Equals(GameConfig.STAGE_COUNT);

            green.SetActive(isScoreAttackClear);
        }
Example #41
0
    protected void OnDestroy()
    {
        if (updateDelegates != null)
        {
            for (int i = 0; i < (int)SceneState.Count; i++)
            {
                updateDelegates [i] = null;
            }
            updateDelegates = null;
        }

        if (mainController != null)
        {
            mainController = null;
        }
    }
Example #42
0
 public LoaderTempMesh( SceneLoader _Owner, string _Name )
     : base(_Owner, _Name)
 {
     if ( _Name.IndexOf( "polysurface12", StringComparison.CurrentCultureIgnoreCase ) != -1 )
         m_Name = _Name;
 }
Example #43
0
 public void LoadGameScene()
 {
     StartCoroutine(SceneLoader.LoadSceneAsync("Game"));
 }
Example #44
0
 public LoaderTempTransform( SceneLoader _Owner, string _Name )
     : base(_Owner, _Name)
 {
 }
Example #45
0
 public void LoadAlbumScene()
 {
     StartCoroutine(SceneLoader.LoadSceneAsync("Album"));
 }
 public LoaderTempTextureCube( SceneLoader _Owner, string _Name )
     : base(_Owner, _Name)
 {
 }
Example #47
0
 private void Start()
 {
     sceneLoader = FindObjectOfType <SceneLoader>();
     audioSource = GetComponent <AudioSource>();
 }
Example #48
0
 void Awake()
 {
     Instance = this;
 }
Example #49
0
 private void Awake()
 {
     masterManager = FindObjectOfType <MasterManager>();
     sceneLoader   = masterManager.GetComponentInChildren <SceneLoader>();
 }
Example #50
0
 // Start is called before the first frame update
 void Start()
 {
     SceneLoader = FindObjectOfType <SceneLoader>();
     rigidbody2D = GetComponent <Rigidbody2D>();
     //rigidbody2D.velocity = new Vector2(UnityEngine.Random.Range(3, 10), UnityEngine.Random.Range(3, 10));
 }
Example #51
0
 private void Awake()
 {
     _mainMenuManager = transform.parent.GetComponent <MainMenuManager>();
     _highScoreMenu   = _mainMenuManager.HighScoreMenuRLR;
     _sceneLoader     = _mainMenuManager.SceneLoader;
 }