Exemple #1
0
 private void SetSwitchOnOffStages()
 {
     this.switchStages = new List <SwitchOnOffStage>();
     foreach (GameObject obj in GameObject.FindGameObjectsWithTag("SwitchOnOffStage"))
     {
         this.switchStages.Add(obj.GetComponent <SwitchOnOffStage>());
     }
     foreach (SwitchOnOffStage switchStage in this.switchStages)
     {
         switchStage.InitSet(this.initOnInOnSwitchStageMaterial, this.initOnInOffSwitchStageMaterial, this.initOffInOnSwitchStageMaterial, this.initOffInOffSwitchStageMaterial);
     }
     this.playerWallKickTrigger = GameObject.FindGameObjectsWithTag("Player")[0].transform.Find("WallCheck").GetComponent <WallKickTrigger>();
 }
Exemple #2
0
    private void Awake()
    {
        this._monobitView = GetComponent <MonobitEngine.MonobitView>();

        if (this._monobitView != null && !this._monobitView.isMine)
        {
            return;
        }
        this._rigidbody           = GetComponent <Rigidbody>();
        this._playerAnimation     = GetComponent <PlayerAnimation>();
        this._characterController = GetComponent <CharacterController>();
        this._hitHeadCheck        = this.transform.Find("HitHeadCheck").transform;
        this._groundCheck         = this.transform.Find("GroundCheck").transform;
        this._wallKickTrigger     = this.transform.Find("WallCheck").GetComponent <WallKickTrigger>();

        this._characterController
        .ObserveEveryValueChanged(x => x.isGrounded)
        //.ThrottleFrame(1)
        .Subscribe(x => this._isGrounded = x);
        this.isTitleScene = SceneManager.GetActiveScene().name == "Title";
    }