예제 #1
0
 public void ToFly()
 {
     State = E_State.Fly;
     ioo.gameMode.PlayGameMusic();
     ioo.gameMode.PlayPlaneMusic();
     ioo.audioManager.StopBackMusic(TakeOff_Music);
 }
예제 #2
0
    void HideControls(bool save)
    {
        State = E_State.IngameMenu;

        GuiManager.SetFadeOut(0.7f);

        DefaultSpriteUI.HideSprite(GuiInGameMenu.SpriteControlsOk);
        DefaultSpriteUI.HideSprite(GuiInGameMenu.SpriteControlsCancel);
        DefaultSpriteUI.HideSprite(GuiInGameMenu.SpriteControlsReset);
        DefaultSpriteUI.HideSprite(GuiInGameMenu.SpriteControlsBackground);

        GuiManager.Instance.ShowControlsForCustomize(false);

        DefaultSpriteUI.ShowSprite(GuiInGameMenu.SpriteControls);
        DefaultSpriteUI.ShowSprite(GuiInGameMenu.SpriteResume);
        DefaultSpriteUI.ShowSprite(GuiInGameMenu.SpriteQuit);

        if (save)
        {
            Game.Instance.SaveControls();
            Player.Instance.UpdateControlsPosition();
        }
        else
        {
            Game.Instance.LoadControls();
        }
    }
예제 #3
0
 // change camera mode
 public static void ChangeMode(E_State State)
 {
     if (null != Instance)
     {
         Instance.ChangeStateInternal(State);
     }
 }
예제 #4
0
 private void OnUp()
 {
     Hold      = true;
     CanUpdate = true;
     State     = E_State.Up;
     ioo.audioManager.PlayBackMusic("Music_Player_Lift");
 }
예제 #5
0
    void Init()
    {
        CurIndex                        = 0;
        NextIndex                       = 1;
        MaxLife                         = 200;
        Life                            = MaxLife;
        IsDead                          = false;
        HasStone                        = false;
        HasThrow                        = false;
        CanChangeColor                  = true;
        HasStonrBornEffect              = false;
        ioo.gameMode.Boss               = this;
        State                           = E_State.Idle;
        Root                            = transform.Find("Root").transform;
        PathList                        = ioo.gameMode.Player.BossPathList;
        transform.localPosition         = Vector3.zero;
        transform.localEulerAngles      = Vector3.zero;
        Root.transform.localPosition    = Vector3.zero;
        Root.transform.localEulerAngles = Vector3.zero;

        Anim = Root.GetComponent <Animator>();

        MeshRender.material.SetColor("_EmissionColor", Color.white);

        PlayerPosList.Clear();

        rate = Worth / MaxLife;
    }
    }//end RecieverCode

    //for answer check, grab if "E_State" != Right, sort of deal.
    public void ResetError()
    {///Debug.LogWarning("Resetting value now");

        //reset value of answer check
        state = E_State.Empty;
        if (heldObj != null) {//only apply if reciever/filled  && type == E_Type.Filled
                              //Debug.Log("null check works");
            
            //if in doubt, go nuclear and reload scene instead. Lazy wise

            


            NewRocketPuzzle heldRef = heldObj.GetComponent<NewRocketPuzzle>();
            heldRef.type = E_Type.Puzzle;//reset value of answer check

            if (resetPos != null) { }//jnc cautious check
            else Debug.LogWarning("variable error - resetPos is null");

            //reset heldObj to (mostly) initial settings
            heldObj.transform.position = resetPos;
            heldObj.tag = "Draggable";
            heldObj = null;
        }//endif
        type = E_Type.Reciever;
    }//end ResetError
예제 #7
0
 private void TriggerFly()
 {
     CanUpdate  = true;
     State      = E_State.Fly;
     Anim.speed = 1;
     //ioo.audioManager.PlaySound2D("Music_Dragon_Fire");
 }
예제 #8
0
    /// <summary>
    /// 上への速度を追加、ジャンプモーションへ移行
    /// </summary>
    /// <param name="jumpVerticalSpeed">上方向への初速度</param>
    public void Jump(float jumpVerticalSpeed)
    {
        this.countJumpTime        = 0f;
        this.countJumpLevel       = 0;
        this.checkPressJumpButton = false;
        this._velocity.y          = 0f;

        //進行方向を向く
        if (!(this._velocity.x == 0f && this._velocity.z == 0f))
        {
            this.transform.forward = new Vector3(this._velocity.x, 0f, this._velocity.z);
        }
        //if (this._velocity.magnitude >= this.maxNormalAirHorizontalSpeed) this._velocity *= this.maxNormalAirHorizontalSpeed / this._velocity.magnitude;

        this._velocity.y = jumpVerticalSpeed;
        this._isGrounded = false;

        if (this.currentState != E_State.SpinJumping)
        {
            this.currentState = E_State.JumpToTop;
            this._playerAnimation.Play(PlayerAnimation.E_PlayerAnimationType.JumpToTop);
        }
        SEManager.Instance.Play(SEPath.JUMP_VOICE0, volumeRate: 0.5f);
        SEManager.Instance.Play(SEPath.JUMP_WIND0, volumeRate: 0.4f);
        SEManager.Instance.Play(SEPath.TRAMPOLINE_JUMP, volumeRate: 0.5f);

        this.checkPressJumpButton = true;
        this._wallKickTrigger.ResetTrigger();
    }
예제 #9
0
 public void OnExplosed()
 {
     Life  = 0;
     State = E_State.Dead;
     BugAttack.OnDead();
     EaterTime = 20;
 }
예제 #10
0
    private void OnAttack()
    {
        AnimatorStateInfo info = Anim.GetCurrentAnimatorStateInfo(0);

        if (!info.IsName("Attack"))
        {
            Anim.SetInteger("State", (int)State);
        }
        else
        {
            if (info.normalizedTime >= 1.0f)
            {
                CanMove   = true;
                GetTarget = false;
                Target    = PathList[Index];
                State     = E_State.Move;
            }

            if (info.normalizedTime >= 0.8f && SkillCool)
            {
                SkillCool = false;
                WeaponBehaviour wb = WeaponManager.Instance.CreateWeapon(ModelName.WFireBall);
                wb.transform.position = FireBallBorn.position;
                wb.Owner = GameTag.Boss;

                wb.SetMoveToTargetTransform(ioo.gameMode.Player.BossAttackPoint, 40);
            }
        }
    }
예제 #11
0
    /// <summary>
    /// 壁キック
    /// </summary>
    public void WallKick()
    {
        if (this._velocity.y >= -0.05f)
        {
            return;
        }

        this._isGrounded  = false;
        this.currentState = E_State.JumpToTop;

        //移動させる
        this._velocity = new Vector3(this.NormalOfStickingWall.x * this.wallKickHorizontalSpeed + this._velocity.x, this.wallKickVerticalSpeed, this.NormalOfStickingWall.z * this.wallKickHorizontalSpeed + this._velocity.z);

        //回転
        //this.transform.forward = this.NormalOfStickingWall; //壁の法線ベクトルを向く
        this.transform.forward = new Vector3(this._velocity.x, 0f, this._velocity.z); //移動方向を向く

        //animation
        this._playerAnimation.Play(PlayerAnimation.E_PlayerAnimationType.JumpToTop);

        SEManager.Instance.Stop(SEPath.STICKING_WALL);
        SEManager.Instance.Play(SEPath.JUMP_VOICE3, volumeRate: 0.7f);
        SEManager.Instance.Play(SEPath.JUMP_WIND0, volumeRate: 0.4f);

        //StartCoroutine(CoroutineManager.DelayMethod(0.3f, () => this.IsStickingWall = false));
    }
예제 #12
0
    void StartEnd()
    {
        string AnimName = Owner.AnimSet.GetCoverAnim(AnimSet.E_CoverAnim.AimEnd, Action.CoverPose, Action.CoverDirection);

        //Debug.Log("start end " + AnimName);

        State = E_State.End;

        Animation[AnimName].speed = 1.3f;
        EndOfStateTime            = Animation[AnimName].length * 0.7f + Time.timeSinceLevelLoad;
        Owner.WeaponComponent.GetCurrentWeapon().SetBusy(Animation[AnimName].length);
        Owner.BlackBoard.CoverFire = false;

        CrossFade(AnimName, 0.15f, PlayMode.StopAll);
        Owner.SetDominantAnimName(AnimName);

        if (uLink.Network.isClient && Owner.NetworkView.isMine)
        {
            float newFOV = GameCamera.Instance.DefaultFOV;
            if (Owner.IsInCover)
            {
                newFOV *= Owner.WeaponComponent.GetCurrentWeapon().CoverFovModificator;
            }
            GameCamera.Instance.SetFov(newFOV, 60);
        }

        BlendUp    = 0;
        BlendDown  = 0;
        BlendRight = 0;
        BlendLeft  = 0;

        Owner.BlackBoard.BusyAction = true;
        Owner.WeaponComponent.DisableCurrentWeapon(Animation[AnimName].length);
    }
예제 #13
0
    /*void OnEnable()
     * {
     *  Debug.Log(GameObject.name + " OnEnable");
     * }
     * void OnDisable()
     * {
     *  Debug.Log(GameObject.name + " Ondisable");
     * }*/

    // Update is called once per frame
    void FixedUpdate()
    {
        for (int i = EnemiesAlive.Count - 1; i >= 0; i--)
        {
            if (EnemiesAlive[i].IsAlive == true)
            {
                continue;
            }

            EnemiesAlive.RemoveAt(i);
        }

        if (State != E_State.E_IN_PROGRESS)
        {
            return;
        }

        if (EnemiesAlive.Count == 0)
        {
            State = E_State.E_FINISHED;

            if (LockOut != null)
            {
                LockOut.Unlock();
            }

            if (SoundDataManager.Instance.IsSwitchingMusic())
            {
                Mission.Instance.SetNewMusic(SoundDataManager.Instance.CalmMusic, SoundDataManager.Instance.CalmMusicVolume, SoundDataManager.Instance.CalmMusicFadeOutTime, SoundDataManager.Instance.CalmMusicFadeInTime);
            }

            MyGameZone.EnableAllActiveInteraction(true);
        }
    }
예제 #14
0
    public void Lock()
    {
        if (State == E_State.E_ON)
        {
            return;
        }

        State = E_State.E_ON;

        GameObject.SetActive(true);

        if (Collision != null)
        {
            Collision.SetActive(true);
        }

        if (AnimON != null)
        {
            Animation.Play(AnimON.name);
        }

        if (AnimLoop != null)
        {
            Animation.PlayQueued(AnimLoop.name);
        }

        if (SoundOn != null)
        {
            AudioSource.PlayOneShot(SoundOn);
        }



        //    Debug.Log(GameObject.name + " Lock " + State);
    }
예제 #15
0
 /// <summary>
 /// ヒップドロップ。空中でvelocity0に。一瞬待って真下に等速運動
 /// </summary>
 private void HipDrop()
 {
     this.StopAllCoroutineOfRotation(); //現在はbackFlipのコルーチンのみ
     //this.IsStickingWall = false;
     this.IsHipDropping      = true;
     this._velocity          = Vector3.zero;
     this.transform.rotation = new Quaternion(0f, this.transform.rotation.y, 0f, this.transform.rotation.w);
     this.currentState       = E_State.HipDropping;
     this._playerAnimation.Play(PlayerAnimation.E_PlayerAnimationType.HipDrop);
     SEManager.Instance.Stop(SEPath.STICKING_WALL);
     SEManager.Instance.Play(SEPath.JUMP_VOICE8, volumeRate: 0.5f);
     SEManager.Instance.Play(SEPath.HIP_DROP_ROTATE);
     //CapsuleCollider _collider = GetComponent<CapsuleCollider>();
     this._hitHeadCheck.localPosition = Vector3.zero;
     this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero);
     this._groundCheck.localPosition  = Vector3.zero;
     this._groundCheck.localRotation  = Quaternion.Euler(Vector3.zero);
     if (this.CountGroundNearFoots == 0) //地面スレスレでないとき
     {
         StartCoroutine(TransformManager.RotateInCertainTimeByAxisFromAway(this.transform, this.CenterPosition, E_TransformAxis.Right, 360f, 0.14f));
         StartCoroutine(TransformManager.RotateInCertainTimeByAxisFromAway(this._hitHeadCheck, this.CenterPosition, E_TransformAxis.Right, -360f, 0.14f));
         StartCoroutine(TransformManager.RotateInCertainTimeByAxisFromAway(this._groundCheck, this.CenterPosition, E_TransformAxis.Right, -360f, 0.14f));
         StartCoroutine(CoroutineManager.DelayMethod(0.15f, () =>
         {
             this._hitHeadCheck.localPosition = Vector3.zero;
             this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero);
             this._groundCheck.localPosition  = Vector3.zero;
             this._groundCheck.localRotation  = Quaternion.Euler(Vector3.zero);
         }));
     }
     StartCoroutine(CoroutineManager.DelayMethod(0.3f, () =>
     {
         this._velocity.y = -1 * this.hipDropVerticalSpeed;
     }));
 }
예제 #16
0
    protected override void Initialize(AgentAction action)
    {
        base.Initialize(action);

        Action = action as AgentActionUse;

        //  Debug.Log(Time.timeSinceLevelLoad + " Action.InterObj.UseTime " + Action.InterObj.UseTime);

        if (Action.InterObj.GetEntryTransform())
        {
            StartPosition = Transform.position;
            StartRotation = Transform.rotation;

            FinalRotation.SetLookRotation(Action.InterObj.GetEntryTransform().forward);
            FinalPosition = Action.InterObj.GetEntryTransform().position;

            CurrentMoveTime = 0;
            MoveTime        = 0.2f;

            PositionOK = false;
        }
        else
        {
            PositionOK = true;
        }

        State = E_State.E_PREPARING_FOR_USE;
    }
예제 #17
0
    //private void Attack()
    //{
    //    if (State == E_State.Dead)
    //        return;
    //    CanMove = false;
    //    SkillCool = true;
    //    State = E_State.Attack;
    //    ioo.audioManager.PlayPersonSound("Person_Sound_Boss_Attack" + Random.Range(0, 3));
    //}

    private void Bellow()
    {
        if (State == E_State.Dead)
        {
            return;
        }
        CanMove                   = false;
        SkillCool                 = true;
        State                     = E_State.Bellow;
        MeshCollider.enabled      = false;
        ioo.gameMode.Player.Pause = true;
        ioo.gameMode.TimeScale(0.05f);
        FireEffect.SetActive(true);
        UsedHitList.Clear();

        int rand = Random.Range(0, HitList.Count);

        for (int i = 0; i < HitList.Count; ++i)
        {
            if (i == rand)
            {
                continue;
            }
            UsedHitList.Add(HitList[i]);
            //HitList[i].EnableCollider();
        }

        ioo.audioManager.PlayPersonSound("Person_Sound_Boss_Attack" + Random.Range(0, 3));
        CanUpdateHit = true;
        CurIndex     = 0;
        HitWaitTime  = 0;
        HitWait      = false;
    }
예제 #18
0
파일: SpawnDojo.cs 프로젝트: cuongdv/wushi2
    IEnumerator SpawnEnemiesInRounds(Round.RoundInfo[] SpawnRounds)
    {
        State = E_State.E_SPAWNING_ENEMIES;

        for (int i = 0; i < SpawnRounds.Length; i++)
        {
            Round.RoundInfo round = SpawnRounds[i];

            float delay = round.SpawnDelay;

            while (delay > 0)
            {
                if (EnemiesAlive.Count == 0 || EnemiesAlive.Count <= round.MinEnemiesFomLastRound)
                {
                    break;
                }

                yield return(new WaitForSeconds(0.5f));

                delay -= 0.5f;
            }

            for (int ii = 0; ii < round.Spawns.Length; ii++)
            {
                Round.RoundInfo.SpawnInfo spawnInfo = round.Spawns[ii];

                yield return(new WaitForSeconds(spawnInfo.SpawnDelay));

                SpawnPointEnemy spawnpoint = GetAvailableSpawnPoint(spawnInfo.SpawnPoint == null || spawnInfo.SpawnPoint.Length == 0 ? SpawnPoints : spawnInfo.SpawnPoint);

                if (spawnInfo.RotateToPlayer)
                {
                    Vector3 dir = Player.Instance.Agent.Position - spawnpoint.Transform.position;
                    dir.Normalize();
                    spawnpoint.Transform.forward = dir;
                }

                GameObject enemy = Mission.Instance.GetHuman(spawnInfo.EnemyType, spawnpoint.Transform);

                while (enemy == null)
                {
                    yield return(new WaitForSeconds(0.2f));

                    enemy = Mission.Instance.GetHuman(spawnInfo.EnemyType, spawnpoint.Transform);
                }

                CombatEffectsManager.Instance.PlaySpawnEffect(spawnpoint.Transform.position, spawnpoint.Transform.forward);

                Agent agent = enemy.GetComponent("Agent") as Agent;
                agent.PrepareForStart();

                MyGameZone.AddEnemy(agent);
                EnemiesAlive.Add(agent);

                yield return(new WaitForSeconds(0.1f));
            }
        }

        State = E_State.E_IN_PROGRESS;
    }
예제 #19
0
    /// <summary>
    /// 巡逻
    /// </summary>
    private void OnPatrol()
    {
        if (!BugAttack.gameObject.activeSelf)
        {
            BugAttack.gameObject.SetActive(true);
            BugAttack.transform.localPosition    = BugAttack.Offset;
            BugAttack.transform.localEulerAngles = Vector3.zero;
        }

        float dis = Vector3.Distance(transform.position, ioo.gameMode.Player.FirePoint.transform.position);

        if (dis <= SearchLength)
        {
            BugAttack.Chase = true;
            State           = E_State.Chase;
            return;
        }

        Vector3 dir = PatrolList[CurIndex].transform.position - transform.position;

        if (dir.magnitude < 0.4f)
        {
            ++CurIndex;
            CurIndex %= PatrolList.Count;
        }
        else
        {
            transform.position += dir.normalized * Time.deltaTime * PatrolSpeed * 0.5f;
            Quaternion toRotation = Quaternion.LookRotation(dir);
            transform.rotation = Quaternion.Lerp(transform.rotation, toRotation, Time.deltaTime * 10);
        }
    }
예제 #20
0
    void EndOfDojo()
    {
        State = E_State.E_FINISHED;

        //Debug.Log("StartEndOfDojo " + Game.Instance.CurrentSurvivalRound);

        Mission.Instance.EndOfMission(true);
    }
예제 #21
0
    public override void Restart()
    {
        State = E_State.E_OFF;
        gameObject.SetActive(true);
        Animation.Stop();
        AnimON.SampleAnimation(InteractionObject, 0);

        base.Restart();
    }
예제 #22
0
 void UpdateAim()
 {
     if (EndOfStateTime <= Time.timeSinceLevelLoad)
     {
         State = E_State.Fire;
         Owner.BlackBoard.BusyAction = false;
         Action.SetSuccess();
     }
 }
예제 #23
0
 private void Init()
 {
     InPath          = false;
     CurIndex        = 0;
     Life            = OrgLife;
     State           = E_State.Patrol;
     Percent         = NearestPercent;
     BugAttack.Chase = false;
 }
예제 #24
0
    protected override void Initialize(AgentAction action)
    {
        base.Initialize(action);

        Action = action as AgentActionCoverFire;

        AnimNameBase = Owner.AnimSet.GetCoverAnim(AnimSet.E_CoverAnim.AimStart, Action.CoverPose, Action.CoverDirection);
        Animation[AnimNameBase].speed = 1.2f;

        EndOfStateTime = Animation[AnimNameBase].length * 0.9f + Time.timeSinceLevelLoad;

        Owner.WeaponComponent.GetCurrentWeapon().SetBusy(Animation[AnimNameBase].length);

        Owner.BlackBoard.MotionType = E_MotionType.None;

        State = E_State.Start;

        AnimNameUp    = Owner.AnimSet.GetAimAnim(E_AimDirection.Up, Action.CoverPose, Action.CoverDirection);
        AnimNameDown  = Owner.AnimSet.GetAimAnim(E_AimDirection.Down, Action.CoverPose, Action.CoverDirection);
        AnimNameRight = Owner.AnimSet.GetAimAnim(E_AimDirection.Right, Action.CoverPose, Action.CoverDirection);
        AnimNameLeft  = Owner.AnimSet.GetAimAnim(E_AimDirection.Left, Action.CoverPose, Action.CoverDirection);

        Animation[AnimNameUp].layer    = 1;
        Animation[AnimNameDown].layer  = 1;
        Animation[AnimNameRight].layer = 1;
        Animation[AnimNameLeft].layer  = 1;

        //AnimName = Owner.AnimSet.GetCoverAnim(AnimSet.E_CoverAnim.AimLoop, Owner.BlackBoard.CoverPose, Owner.BlackBoard.CoverDirection);
        Animation[AnimNameBase].wrapMode = WrapMode.ClampForever;

        CrossFade(AnimNameBase, 0.15f, PlayMode.StopSameLayer);
        Owner.SetDominantAnimName(AnimNameBase);

        float time = Animation[AnimNameBase].length * 0.9f;

        if (uLink.Network.isClient && Owner.NetworkView.isMine)
        {
            float newFOV = GameCamera.Instance.DefaultFOV;
            newFOV *= Owner.WeaponComponent.GetCurrentWeapon().CoverFireFovModificator;
            GameCamera.Instance.SetFov(newFOV, 60);
        }

        UpdateBlendValues();

        Animation[AnimNameUp].weight    = 0;
        Animation[AnimNameDown].weight  = 0;
        Animation[AnimNameRight].weight = 0;
        Animation[AnimNameLeft].weight  = 0;

        Animation.Blend(AnimNameUp, BlendUp, time);
        Animation.Blend(AnimNameDown, BlendDown, time);
        Animation.Blend(AnimNameRight, BlendRight, time);
        Animation.Blend(AnimNameLeft, BlendLeft, time);

        Owner.WeaponComponent.DisableCurrentWeapon(time);
    }
예제 #25
0
    public void Enable()
    {
        gameObject.SetActive(true);

        State = E_State.WaitStart;
        for (int i = 0; i < SpawnZones.Length; i++)
        {
            SpawnZones [i].Enable();
        }
    }
예제 #26
0
    void HideItems(E_CommandID activeCommandId)
    {
        if (m_State != E_State.Visible)
        {
            return;
        }
        m_State = E_State.Hidding;

        Owner.StartCoroutine(HideItems_Coroutine(activeCommandId));
    }
예제 #27
0
 protected override JobHandle OnUpdate(JobHandle inputDeps)
 {
     Entities.ForEach((in C_SyncAnimationMono pSync) =>
     {
         if (m_LastState != pSync.State)
         {
             m_LastState = pSync.State;
             m_Animations.GetObject(pSync.Id).SetTrigger(pSync.State.ToString());
         }
     })
예제 #28
0
    /// <summary>
    /// スピンジャンプ。水平方向に移動しやすい。
    /// </summary>
    private void SpinJump()
    {
        this._isGrounded = false;
        this._velocity.y = this.spinJumpVerticalSpeed;

        this.currentState = E_State.SpinJumping;
        this._playerAnimation.Play(PlayerAnimation.E_PlayerAnimationType.SpinJump);
        SEManager.Instance.Play(SEPath.JUMP_VOICE7, volumeRate: 0.5f);
        SEManager.Instance.Play(SEPath.JUMP_WIND1);
    }
예제 #29
0
    private void InitializeKnockdownUp()
    {
        string animName = Owner.AnimSet.GetKnockdowAnim(E_KnockdownState.Up, Owner.BlackBoard.WeaponSelected);

        CrossFade(animName, 0.05f);

        EndOfStateTime = Time.timeSinceLevelLoad + AnimEngine[animName].length * 0.9f;

        State = E_State.End;
        Owner.EnableCollisions();
    }
예제 #30
0
    private void InitializeDeath()
    {
        string animName = Owner.AnimSet.GetKnockdowAnim(E_KnockdownState.Fatality, Owner.BlackBoard.WeaponSelected);

        CrossFade(animName, 0.1f);

        EndOfStateTime = Time.timeSinceLevelLoad + AnimEngine[animName].length * 0.9f;
        ActionDeath.SetSuccess();
        State = E_State.Death;
        Owner.BlackBoard.MotionType = E_MotionType.Death;
    }