コード例 #1
0
    // Start is called before the first frame update
    protected override void Start()
    {
        base.Start();
        BehaviourMap mapping = GetComponent <BehaviourMap>();

        mapping.behaviourMap.Add(UnitController.TargetType.Enemy, GetType());
        animator = GetComponent <Animator>();
        state    = AttackUnitState.DEFENDING;
    }
コード例 #2
0
    private void ChangeState(AttackUnitState toState)
    {
        if (currentRoutine != null)
        {
            StopCoroutine(currentRoutine);
            currentRoutine = null;
        }

        animator.SetBool("Attacking", false);
        target = null;

        state = toState;
    }
コード例 #3
0
ファイル: WavePattern.cs プロジェクト: Foxshiver/Project-JV
    // Constructor
    public WavePattern(Unit unit)
    {
        _unit = unit;

        seekBehavior    = new SeekBehavior(_unit);
        pursuitBehavior = new PursuitBehavior(_unit);

        reachTargetState  = new ReachTargetState(this, seekBehavior);
        attackTargetState = new AttackTargetState(this, seekBehavior);
        attackUnitState   = new AttackUnitState(this, pursuitBehavior);

        currentState = reachTargetState;
    }