Exemplo n.º 1
0
    public void Init(
        string unitName,
        NavMeshAgent navAgent,
        IUnit unit,
        bool startImobilized
        )
    {
        _navAgent = navAgent;
        _unit     = unit;

        if (startImobilized)
        {
            _navAgent.enabled = false;
        }

        // Init Values
        _walkTurnSpeed = 11.0f;
        //_turnSpeed = 4.0f;
        _lerpTime = 0.6f;

        _lerpRotation = LerpToRotation();

        if (UnitTarget == null)
        {
            UnitTarget = WorldUtils.CreateUnitTarget(unitName);
        }
    }