예제 #1
0
	public void ProcessAction( ActionTypeName currentAction)
	{
		ProcessEffects ();

		if (m_actionReceiverEntity != null) 
		{
			currentController = m_actionReceiverEntity.gameObject.GetComponent<AniStateController> ();
		}

		switch (currentAction) {
		case ActionTypeName.DealDamage:
			{
				if (m_actionReceiverEntity != null)
				{
					m_actionReceiverEntity.ApplyDamage(_damageAmount);
					Debug.Log ("Damage Dealt to: " + _actionReceiver.name);

					if ( currentController != null )
					{
						currentController.StartCoroutine("TakeHit", 0.25f );
					}
				}
				break;
			}
		case ActionTypeName.AddHealth:
			{
				if (m_actionCasterEntity != null)
				{
					m_actionCasterEntity.AddHealth(_healAmount);
					Debug.Log ("Health added to: " + _actionCaster.name); 
				}
				break;
			}
		case ActionTypeName.AddArmor:
			{
				if (m_actionCasterEntity != null)
				{
					m_actionCasterEntity.AddArmor(_armorAdd);
					Debug.Log ("Armor added to: " + _actionCaster.name); 
				}
				break;
			}

		case ActionTypeName.DetractArmor:
			{
				if (m_actionReceiverEntity != null)
				{
					m_actionReceiverEntity.DetractArmor(_armorDetract);

					if ( currentController != null )
					{
						currentController.StartCoroutine("TakeHit", 0.25f );
					}
				}
				break;
			}
		}

	}
예제 #2
0
	void Start()
	{
		_target = FindObjectOfType<HeroController> ().gameObject;
		_actionToPassCombat = _autoAction;
		_EntityController = this.gameObject.GetComponent<EntityMain> ();
		m_aniController = gameObject.GetComponent<AniStateController> ();

		if (m_aniController == null)
			Debug.LogWarning ("No Animation Controller on Enemy!");
	}
예제 #3
0
    /// <summary>
    /// Update
    /// </summary>
    public override void Update(float time, AniStateController controller)
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            controller.SetAniState(SetState(enumAniState.Attack1));
        }

        if (Input.GetKeyDown(KeyCode.S))
        {
            controller.SetAniState(SetState(enumAniState.Attack2));
        }
    }
예제 #4
0
    /// <summary>
    /// Update
    /// </summary>
    public override void Update(float time, AniStateController controller)
    {
        updateTime += time;

        if (updateTime > 0.8f)
        {
            controller.SetAniState(SetState(_reserveState));
        }
        else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S))
        {
            switch (currentAniState)
            {
            case enumAniState.Attack1:
                _reserveState = enumAniState.Attack2;
                break;

            case enumAniState.Attack2:
                _reserveState = enumAniState.Attack3;
                break;
            }
        }
    }
예제 #5
0
 public abstract void Update(float time, AniStateController controller);
예제 #6
0
    // Use this for initialization
    void Start()
    {
        Animator anim = gameObject.GetComponent <Animator>();

        controller = new AniStateController(anim);
    }