コード例 #1
0
 public void SetState(WitchState state)
 {
     m_states[m_witch.State].EndState();
     m_states[m_witch.State].enabled = false;
     m_witch.State = state;
     m_states[m_witch.State].enabled = true;
     m_states[m_witch.State].BeginState();
 }
コード例 #2
0
ファイル: WitchBoss.cs プロジェクト: Heimish/Redwing_Asset
 private void Awake()
 {
     m_stateSystem       = GetComponent <WitchStateSystem>();
     m_stateSystem.Witch = this;
     m_skillSystem       = GetComponent <WitchSkillSystem>();
     m_skillSystem.Witch = this;
     m_curState          = WitchState.Idle;
 }
コード例 #3
0
ファイル: WitchBoss.cs プロジェクト: abu0512/TestProject
    public void SetState(WitchState state)
    {
        if (_curState == state)
        {
            return;
        }

        _stateSystem.SetState(state);
    }
コード例 #4
0
    public void SetState(WitchState state)
    {
        Witch.Anim.SetInteger("State", (int)state);

        _states[_witch.State].EndState();
        _states[_witch.State].enabled = false;
        _witch.State = state;
        _states[_witch.State].enabled = true;
        _states[_witch.State].BeginState();
    }
コード例 #5
0
ファイル: WitchBoss.cs プロジェクト: abu0512/TestProject
 protected override void Awake()
 {
     base.Awake();
     _stateSystem       = GetComponent <WitchStateSystem>();
     _stateSystem.Witch = this;
     _skillSystem       = GetComponent <WitchSkillSystem>();
     _skillSystem.Witch = this;
     _curState          = WitchState.Groggy;
     _player            = FindObjectOfType <CPlayerManager>();
     _receiveDamage     = 0.0f;
     _collider          = FindObjectOfType <WitchWeaponCollider>();
     //_footHoldSpawnTime = WitchValueManager.I.FootholdContinueTime;
     _spawner   = FindObjectOfType <WitchMonsterSpawnerObject>();
     _isGravity = true;
 }
コード例 #6
0
ファイル: Witch.cs プロジェクト: agaubatz/ggj16
	public void DealDamage(float damage) {
		if (state == WitchState.Melted)
			return;
		health -= damage;
		speed = 0;

		switch(state) {
		case WitchState.Idle:
			animator.SetBool ("Idle", false);
			break;
		case WitchState.Walking:
			animator.SetBool ("Walk", false);
			break;
		case WitchState.Lunging:
		case WitchState.Spellcasting:
			animator.SetBool ("DoWitchyAction", false);
			break;
		}

		if (health <= 0) {
			state = WitchState.Melted;
			AudioSource.PlayClipAtPoint (DeathSound, transform.localPosition);
			animator.SetBool ("Die", true);
		} else {
			if (!wasDamaged) {
				wasDamaged = true;
				AudioSource.PlayClipAtPoint (ScreamSound, transform.localPosition);
			}
			state = WitchState.Damaged;
			animator.SetBool("Hit", true);
		}


	}
コード例 #7
0
ファイル: WitchBoss.cs プロジェクト: abu0512/TestProject
 public void SetAnimation(WitchState state)
 {
     _anim.SetInteger("State", (int)state);
 }
コード例 #8
0
ファイル: Witch.cs プロジェクト: BorisFR/Cauldron
        } // MoveToRight

        // *********************************************************************

        public float MoveToLeft()
        {
            moving = true;
            switch (state)
            {
            case WitchState.LeftWalk:
                if (X > All.MIDDLE_MAP)
                {
                    X -= 1;
                    return(0.0f);
                }
                if (!couldScroll)
                {
                    X -= 1;
                    return(0.0f);
                }
                // TODO: changer ça si on veut bloquer le scroll de la carte (sous terrain)
                // faire plutôt X+=1 et retourner 0.0f
                return(SPEED_SLOW);

            case WitchState.LeftMount:
                return(0);

            case WitchState.LeftDescend:
                return(0);

            case WitchState.LeftFlySlow:
                X += 3;
                if (X >= All.SPEED_RIGHT_MIDDLE)
                {
                    ChangeToState(WitchState.LeftFlyMiddle);
                    return(CalcSpeedRight());
                }
                return(0.0f);

            case WitchState.LeftFlyMiddle:
                X += 3;
                if (X >= All.SPEED_RIGHT_MAX)
                {
                    ChangeToState(WitchState.LeftFlyMax);
                }
                return(CalcSpeedRight());

            case WitchState.LeftFlyMax:
                return(CalcSpeedRight());

            case WitchState.RightWalk:     // demi-tour
                currentStep = toRight.StepAnim;
                toLeft.SetAnimSteps(currentStep, currentStep, 0);
                state = WitchState.LeftWalk;
                return(0);

            case WitchState.RightMount:
                return(0);

            case WitchState.RightDescend:
                return(0);

            case WitchState.RightFlySlow:
                X += 3;
                if (X > All.MIDDLE_MAP)
                {
                    ChangeToState(WitchState.LeftFlySlow);
                }
                return(0.0f);

            case WitchState.RightFlyMiddle:
                X += 3;
                if (X > All.SPEED_LEFT_MIDDLE)
                {
                    ChangeToState(WitchState.RightFlySlow);
                    return(0.0f);
                }
                return(-CalcSpeedLeft());

            case WitchState.RightFlyMax:
                X += 3;
                if (X > All.SPEED_LEFT_MAX)
                {
                    ChangeToState(WitchState.RightFlyMiddle);
                }
                return(-CalcSpeedLeft());

            case WitchState.EnterDoor:
                return(0);

            case WitchState.ExitingDoor:
                return(0);

            case WitchState.MakePotion:
                return(0);

            case WitchState.Dying:
                return(0);
            }
            return(0);
        } // MoveToLeft
コード例 #9
0
ファイル: Witch.cs プロジェクト: BorisFR/Cauldron
        // *********************************************************************

        private void ChangeToState(WitchState newState)
        {
            if (state == WitchState.Dying)
            {
                return;
            }
            switch (newState)
            {
            case WitchState.LeftWalk:
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_WALK);
                break;

            case WitchState.LeftMount:
                toLeft.SetAnimSteps(3, 8, ANIM_DELAY_MOUNT, true);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_MOUNT);
                break;

            case WitchState.LeftDescend:
                toLeft.SetAnimSteps(8, 3, ANIM_DELAY_MOUNT, true);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_MOUNT);
                break;

            case WitchState.LeftFlySlow:
                toLeft.SetAnimSteps(8, 9, ANIM_DELAY_FLY_SLOW);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_FLY_SLOW);
                break;

            case WitchState.LeftFlyMiddle:
                toLeft.SetAnimSteps(14, 17, ANIM_DELAY_FLY_MIDDLE);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_FLY_MIDDLE);
                break;

            case WitchState.LeftFlyMax:
                toLeft.SetAnimSteps(10, 13, ANIM_DELAY_FLY_MAX);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_FLY_MAX);
                break;

            case WitchState.RightWalk:
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_WALK);
                break;

            case WitchState.RightMount:
                toRight.SetAnimSteps(3, 8, ANIM_DELAY_MOUNT, true);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_MOUNT);
                break;

            case WitchState.RightDescend:
                toRight.SetAnimSteps(8, 3, ANIM_DELAY_MOUNT, true);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_MOUNT);
                break;

            case WitchState.RightFlySlow:
                toRight.SetAnimSteps(8, 9, ANIM_DELAY_FLY_SLOW);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_FLY_SLOW);
                break;

            case WitchState.RightFlyMiddle:
                toRight.SetAnimSteps(14, 17, ANIM_DELAY_FLY_MIDDLE);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_FLY_MIDDLE);
                break;

            case WitchState.RightFlyMax:
                toRight.SetAnimSteps(10, 13, ANIM_DELAY_FLY_MAX);
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_FLY_MAX);
                break;

            case WitchState.MakePotion:
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_MAKE_POTION);
                break;

            case WitchState.Dying:
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_DYING);
                break;

            case WitchState.ExitingDoor:
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_DOOR_ENTER);
                break;

            case WitchState.EnterDoor:
                animElaps = TimeSpan.FromMilliseconds(ANIM_DELAY_DOOR_ENTER);
                break;
            }
            state     = newState;
            startAnim = DateTime.UtcNow;
            PrintState();
        }
コード例 #10
0
ファイル: Witch.cs プロジェクト: BorisFR/Cauldron
        // *********************************************************************

        public void DoAlive()
        {
            couldScroll = true;
            state       = WitchState.MakePotion;
            PrintState();
        }
コード例 #11
0
ファイル: WitchBoss.cs プロジェクト: Heimish/Redwing_Asset
 public void SetState(WitchState state)
 {
     m_stateSystem.SetState(state);
 }
コード例 #12
0
    public void UpdateAnimations(WitchState witch)
    {
        base.UpdateAnimations(witch);

        /* call on some WitchState functions... */
    }