Esempio n. 1
0
    override public void OnDeactivate()
    {
        //Time.timeScale = 1;

        Action.SetSuccess();
        Action = null;
        base.OnDeactivate();
    }
Esempio n. 2
0
    public override void Activate()
    {
        base.Activate();

        Action             = AgentActionFactory.Create(AgentActionFactory.E_Type.E_USE_LEVER) as AgentActionUseLever;
        Action.Interaction = Owner.BlackBoard.Interaction;
        Action.InterObj    = Owner.BlackBoard.InteractionObject;

        Owner.BlackBoard.ActionAdd(Action);

        Owner.BlackBoard.Stop = true;
    }
Esempio n. 3
0
    protected override void Initialize(AgentAction action)
    {
        base.Initialize(action);

        Action = action as AgentActionUseLever;

        StartRotation = Transform.rotation;
        StartPosition = Transform.position;
        FinalRotation.SetLookRotation(Action.InterObj.GetEntryTransform().forward);
        FinalPosition = Action.InterObj.GetEntryTransform().position;


        RotationProgress = 0;
        CurrentMoveTime  = 0;
        MoveTime         = 0.1f;


        RotationOk = false;
        PositionOK = false;

        State = E_State.E_PREPARING_FOR_USE;
    }
Esempio n. 4
0
    static public AgentAction Create(E_Type type)
    {
        int index = (int)type;

        AgentAction a;

        if (m_UnusedActions[index].Count > 0)
        {
            a = m_UnusedActions[index].Dequeue();
        }
        else
        {
            switch (type)
            {
            case E_Type.E_IDLE:
                a = new AgentActionIdle();
                break;

            case E_Type.E_MOVE:
                a = new AgentActionMove();
                break;

            case E_Type.E_GOTO:
                a = new AgentActionGoTo();
                break;

            case E_Type.E_COMBAT_MOVE:
                a = new AgentActioCombatMove();
                break;

            case E_Type.E_ATTACK:
                a = new AgentActionAttack();
                break;

            case E_Type.E_ATTACK_ROLL:
                a = new AgentActionAttackRoll();
                break;

            case E_Type.E_ATTACK_WHIRL:
                a = new AgentActionAttackWhirl();
                break;

            case E_Type.E_INJURY:
                a = new AgentActionInjury();
                break;

            case E_Type.E_DAMAGE_BLOCKED:
                a = new AgentActionDamageBlocked();
                break;

            case E_Type.E_BLOCK:
                a = new AgentActionBlock();
                break;

            case E_Type.E_ROLL:
                a = new AgentActionRoll();
                break;

            case E_Type.E_INCOMMING_ATTACK:
                a = new AgentActionIncommingAttack();
                break;

            case E_Type.E_WEAPON_SHOW:
                a = new AgentActionWeaponShow();
                break;

            case E_Type.Rotate:
                a = new AgentActionRotate();
                break;

            case E_Type.E_USE_LEVER:
                a = new AgentActionUseLever();
                break;

            case E_Type.E_PLAY_ANIM:
                a = new AgentActionPlayAnim();
                break;

            case E_Type.E_PLAY_IDLE_ANIM:
                a = new AgentActionPlayIdleAnim();
                break;

            case E_Type.E_DEATH:
                a = new AgentActionDeath();
                break;

            case E_Type.E_KNOCKDOWN:
                a = new AgentActionKnockdown();
                break;

            case E_Type.Teleport:
                a = new AgentActionTeleport();
                break;

            default:
                Debug.LogError("no AgentAction to create");
                return(null);
            }
        }
        a.Reset();
        a.SetActive();

        // DEBUG !!!!!!
        m_ActionsInAction.Add(a);
        return(a);
    }