// Start is called before the first frame update void Start() { pausable = FindObjectOfType <Pausable>(); playerCamera = FindObjectOfType <CameraController>(); rectTransform = GetComponent <RectTransform>(); rectTransform.anchoredPosition = offScreenPosition; timer = 0.0f; }
public void Pause(Pausable pausableFocus) { foreach (Pausable pausable in _pausables) { if (pausableFocus != pausable) { pausable.Pause(); } } _isPaused = true; }
private void Start() { iplayerBinders = this.transform.GetComponentsInChildren <IPlayerBinder>().ToList(); pausable = this.GetComponent <Pausable>(); Observable.Zip(tutorialText.EndStream, tutorialTimer.EndStream) .Subscribe(_ => NextTutorial()); state = -1; Observable.Timer(TimeSpan.FromSeconds(1)) .Subscribe(_ => { ChangeInputEnable(true); NextTutorial(); }); }
// Start is called before the first frame update void Start() { // GameControllerとPausableの取得 GameObject gameControllerObject = GameObject.Find("GameControllerObj"); pausable = gameControllerObject.GetComponent <Pausable>(); gameController = gameControllerObject.GetComponent <GameController>(); // 子のメニューのCanvasを取得 menuCanvas = gameObject.transform.Find("PauseMenuCanvas").gameObject; // メニューを非アクティブにする menuCanvas.SetActive(false); }
private void Start() { iplayerBinders = this.transform.GetComponentsInChildren <IPlayerBinder>().ToList(); pausable = this.GetComponent <Pausable>(); healthManagersControll = this.transform.GetComponentInChildren <HealthManagersControll>(); if (iplayerBinders.Count != 2) { DebugLogger.LogError("I didnt get playerBinder,char generate error"); } CountDisply(); StartCoroutine(StartIvent()); timer.EndStream.Subscribe(n => StartCoroutine(TimeOver())); healthManagersControll.DeadPlayerStream.ThrottleFirst(TimeSpan.FromSeconds(1)).Subscribe(n => StartCoroutine(BreakOut(n))); }
/* * ステージ遷移したい場合 必要なところでこれを呼ぶ * GameController.instance.NextScene(); */ void Start() { pausable = gameObject.GetComponent <Pausable>(); if (instance == null) { instance = this; } else { Destroy(gameObject); } ListSize = gameObjects.Count; StageObject = null; NextStageNum = 0; CurrentStageNum = -1; }
// Use this for initialization void Awake () { myTransform = transform; rigidbody = GetComponent<Rigidbody>(); pausable = new Pausable(onPause, onResume); }
public Pauser(Pausable parent) { this.parent = parent; }
private void Start() { pausable = GameObject.Find("root").GetComponent <Pausable>(); }
// Use this for initialization void Start() { _pousable = GameObject.Find("PauseManager").GetComponent <Pausable>(); }
// Use this for initialization void Start() { init(); m_pausable = new Pausable(); }
[Tooltip("Cadencia disparo, en segundos")] [Range(0, 100)] public float shootRate = 0.2f; protected float timeToNextShoot;
void Update() { if (Input.GetMouseButtonDown(0)) { if (_btnResume.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnResume.currentFrame = 1; _btnResume.y += 4; } else if (_btnRestart.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnRestart.currentFrame = 1; _btnRestart.y += 4; } else if (_btnReturnToMainMenu.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnReturnToMainMenu.currentFrame = 1; _btnReturnToMainMenu.y += 4; } else if (_btnQuit.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnQuit.currentFrame = 1; _btnQuit.y += 4; } } if (Input.GetMouseButtonUp(0)) { if (_btnResume.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnResume.currentFrame = 0; _btnResume.y -= 4; _level.IsPaused = false; _myGame.ShowMouse(false); Pausable.UnPause(); this.Destroy(); } else if (_btnRestart.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnRestart.currentFrame = 0; _btnRestart.y -= 4; switch (_level.GetCurrentLevel) { case 1: _level.IsPaused = false; Pausable.UnPause(); this.Destroy(); _myGame.SetState(MyGame.STATE.LEVEL1); break; case 2: _level.IsPaused = false; Pausable.UnPause(); this.Destroy(); _myGame.SetState(MyGame.STATE.LEVEL2); break; case 3: _level.IsPaused = false; Pausable.UnPause(); this.Destroy(); _myGame.SetState(MyGame.STATE.LEVEL3); break; default: break; } } else if (_btnReturnToMainMenu.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnReturnToMainMenu.currentFrame = 0; _btnReturnToMainMenu.y -= 4; _level.IsPaused = false; Pausable.UnPause(); this.Destroy(); _myGame.SetState(MyGame.STATE.MAINMENU); } else if (_btnQuit.HitTestPoint(Input.mouseX, Input.mouseY)) { _btnQuit.currentFrame = 0; _btnQuit.y -= 4; Environment.Exit(0); } } }