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);
	}
示例#3
0
    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>();
 }
示例#5
0
 protected void Awake()
 {
     instance = this;
     DontDestroyOnLoad (transform.gameObject);
     foreach (GameObject go in persistentGameobjects) {
         DontDestroyOnLoad (go);
     }
     fade = gameObject.GetComponent<SceneFadeInOut> ();
 }
示例#6
0
	void Awake(){
		if(ins == null){

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

		}else if(ins != this){

			Destroy(gameObject);
		}
	}
示例#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;
 }
示例#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;
    }
示例#9
0
 public void LoadMenu()
 {
     SceneLoader.LoadLevel("Menu");
 }
示例#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");
 }
示例#12
0
 private void Start()
 {
     sceneLoader = FindObjectOfType <SceneLoader>();
 }
示例#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;
 }
示例#16
0
 public void SwitchBackToMainScene()
 {
     SceneLoader.LoadMainScene();
 }
示例#17
0
 private void Start()
 {
     pindahScene = FindObjectOfType <SceneLoader>();
 }
示例#18
0
 // Start is called before the first frame update
 void Start()
 {
     Debug.Log(gameObject.name, gameObject);
     SceneLoader.LoadScene(load);
 }
示例#19
0
 private void Awake()
 {
     SceneLoader.instance = this;
 }
示例#20
0
 public void Start()
 {
     _sceneLoader = FindObjectOfType <SceneLoader>();
     _playerC     = FindObjectOfType <PlayerController>();
 }
示例#21
0
 private void Start()
 {
     loader    = GameObject.FindObjectOfType <SceneLoader>();
     lostScene = SceneManager.GetActiveScene().buildIndex;
 }
示例#22
0
 private void Awake()
 {
     SceneLoader.OnStartScene();
 }
示例#23
0
 public override void Restart()
 {
     SceneLoader.LoadSceneAsyncSingle(SceneManager.GetActiveScene().buildIndex);
 }
示例#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 + "\"!" );
 }
示例#25
0
 public override void LoadMainMenu()
 {
     SceneLoader.LoadSceneAsyncSingle(0);
 }
示例#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;
    }
示例#27
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     Instance = this;
 }
示例#28
0
 private void Awake()
 {
     loader = GameObject.FindGameObjectWithTag("Scene").GetComponent<SceneLoader>();
     ObjectNear += ScenesJunction_ObjectNear;
 }
示例#29
0
 // Use this for initialization
 private void Awake()
 {
     sceneLoader = SceneLoader.Instance;
 }
示例#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);
    }
示例#31
0
        public void StartLoadScene(string sceneName)
        {
            SceneLoader loader = sceneLoader.AddComponent <SceneLoader>();

            loader.StartLoadScene(sceneName);
        }
示例#32
0
 public void LoadByName(string sceneName)
 {
     SceneLoader.LoadNextScene();
 }
示例#33
0
 public override IEnumerator InitializeEnumerator(object param)
 {
     _outGameButton.onClick.AddListener(() => SceneLoader.LoadScene("OutGame"));
     yield break;
 }
示例#34
0
 private void Awake()
 {
     _sceneLoader = GetComponent <SceneLoader>();
 }
示例#35
0
        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;
        }
示例#36
0
 void Awake()
 {
     if(_instance == null)
         _instance = this;
 }
示例#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);
    }
示例#38
0
 protected override bool _OnCreate(int tableid, SceneLoader loader, params object[] args)
 {
     return true;
 }
示例#39
0
 private void Awake()
 {
     instance = this;
 }
示例#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);
        }
示例#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;
        }
    }
示例#42
0
 public LoaderTempMesh( SceneLoader _Owner, string _Name )
     : base(_Owner, _Name)
 {
     if ( _Name.IndexOf( "polysurface12", StringComparison.CurrentCultureIgnoreCase ) != -1 )
         m_Name = _Name;
 }
示例#43
0
 public void LoadGameScene()
 {
     StartCoroutine(SceneLoader.LoadSceneAsync("Game"));
 }
示例#44
0
 public LoaderTempTransform( SceneLoader _Owner, string _Name )
     : base(_Owner, _Name)
 {
 }
示例#45
0
 public void LoadAlbumScene()
 {
     StartCoroutine(SceneLoader.LoadSceneAsync("Album"));
 }
示例#46
0
 public LoaderTempTextureCube( SceneLoader _Owner, string _Name )
     : base(_Owner, _Name)
 {
 }
示例#47
0
 private void Start()
 {
     sceneLoader = FindObjectOfType <SceneLoader>();
     audioSource = GetComponent <AudioSource>();
 }
示例#48
0
 void Awake()
 {
     Instance = this;
 }
示例#49
0
 private void Awake()
 {
     masterManager = FindObjectOfType <MasterManager>();
     sceneLoader   = masterManager.GetComponentInChildren <SceneLoader>();
 }
示例#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));
 }
示例#51
0
 private void Awake()
 {
     _mainMenuManager = transform.parent.GetComponent <MainMenuManager>();
     _highScoreMenu   = _mainMenuManager.HighScoreMenuRLR;
     _sceneLoader     = _mainMenuManager.SceneLoader;
 }