예제 #1
0
 // 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;
 }
예제 #2
0
    public void Pause(Pausable pausableFocus)
    {
        foreach (Pausable pausable in _pausables)
        {
            if (pausableFocus != pausable)
            {
                pausable.Pause();
            }
        }

        _isPaused = true;
    }
예제 #3
0
        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();
            });
        }
예제 #4
0
    // 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);
    }
예제 #5
0
        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)));
        }
예제 #6
0
    /*
     * ステージ遷移したい場合 必要なところでこれを呼ぶ
     *  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;
    }
예제 #7
0
	// Use this for initialization
	void Awake () {
        myTransform = transform;
        rigidbody = GetComponent<Rigidbody>();
        pausable = new Pausable(onPause, onResume);
	}
예제 #8
0
 public Pauser(Pausable parent)
 {
     this.parent = parent;
 }
예제 #9
0
 private void Start()
 {
     pausable = GameObject.Find("root").GetComponent <Pausable>();
 }
예제 #10
0
 // Use this for initialization
 void Start()
 {
     _pousable = GameObject.Find("PauseManager").GetComponent <Pausable>();
 }
예제 #11
0
 // Use this for initialization
 void Start()
 {
     init();
     m_pausable = new Pausable();
 }
예제 #12
0
 [Tooltip("Cadencia disparo, en segundos")]
 [Range(0, 100)]
 public float shootRate = 0.2f;
 protected float timeToNextShoot;
예제 #13
0
    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);
            }
        }
    }