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>(); }
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); } }
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; }
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; }
public void LoadMenu() { SceneLoader.LoadLevel("Menu"); }
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"); }
private void Start() { sceneLoader = FindObjectOfType <SceneLoader>(); }
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; }
public void SwitchBackToMainScene() { SceneLoader.LoadMainScene(); }
private void Start() { pindahScene = FindObjectOfType <SceneLoader>(); }
// Start is called before the first frame update void Start() { Debug.Log(gameObject.name, gameObject); SceneLoader.LoadScene(load); }
private void Awake() { SceneLoader.instance = this; }
public void Start() { _sceneLoader = FindObjectOfType <SceneLoader>(); _playerC = FindObjectOfType <PlayerController>(); }
private void Start() { loader = GameObject.FindObjectOfType <SceneLoader>(); lostScene = SceneManager.GetActiveScene().buildIndex; }
private void Awake() { SceneLoader.OnStartScene(); }
public override void Restart() { SceneLoader.LoadSceneAsyncSingle(SceneManager.GetActiveScene().buildIndex); }
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 + "\"!" ); }
public override void LoadMainMenu() { SceneLoader.LoadSceneAsyncSingle(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; }
void Awake() { DontDestroyOnLoad(gameObject); Instance = this; }
private void Awake() { loader = GameObject.FindGameObjectWithTag("Scene").GetComponent<SceneLoader>(); ObjectNear += ScenesJunction_ObjectNear; }
// Use this for initialization private void Awake() { sceneLoader = SceneLoader.Instance; }
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); }
public void StartLoadScene(string sceneName) { SceneLoader loader = sceneLoader.AddComponent <SceneLoader>(); loader.StartLoadScene(sceneName); }
public void LoadByName(string sceneName) { SceneLoader.LoadNextScene(); }
public override IEnumerator InitializeEnumerator(object param) { _outGameButton.onClick.AddListener(() => SceneLoader.LoadScene("OutGame")); yield break; }
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; }
void Awake() { if(_instance == null) _instance = this; }
// Start is called before the first frame update //void Start() //{ // //} // //// Update is called once per frame //void Update() //{ // //} public void SwapScenes() { SceneLoader.SwitchScene(1); }
protected override bool _OnCreate(int tableid, SceneLoader loader, params object[] args) { return true; }
private void Awake() { instance = this; }
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); }
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; } }
public LoaderTempMesh( SceneLoader _Owner, string _Name ) : base(_Owner, _Name) { if ( _Name.IndexOf( "polysurface12", StringComparison.CurrentCultureIgnoreCase ) != -1 ) m_Name = _Name; }
public void LoadGameScene() { StartCoroutine(SceneLoader.LoadSceneAsync("Game")); }
public LoaderTempTransform( SceneLoader _Owner, string _Name ) : base(_Owner, _Name) { }
public void LoadAlbumScene() { StartCoroutine(SceneLoader.LoadSceneAsync("Album")); }
public LoaderTempTextureCube( SceneLoader _Owner, string _Name ) : base(_Owner, _Name) { }
private void Start() { sceneLoader = FindObjectOfType <SceneLoader>(); audioSource = GetComponent <AudioSource>(); }
void Awake() { Instance = this; }
private void Awake() { masterManager = FindObjectOfType <MasterManager>(); sceneLoader = masterManager.GetComponentInChildren <SceneLoader>(); }
// 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)); }
private void Awake() { _mainMenuManager = transform.parent.GetComponent <MainMenuManager>(); _highScoreMenu = _mainMenuManager.HighScoreMenuRLR; _sceneLoader = _mainMenuManager.SceneLoader; }