Exemplo n.º 1
0
        public static void SetFollowedUnit(this Agent agent, Agent followedUnit)
        {
            FormationMovementComponent component = agent.GetComponent <FormationMovementComponent>();

            if (component == null)
            {
                return;
            }
            component.FollowedAgent = followedUnit;
        }
Exemplo n.º 2
0
        public static bool GetFormationFrame(
            this Agent agent,
            out WorldPosition formationPosition,
            out Vec2 formationDirection,
            out float speedLimit,
            out bool isSettingDestinationSpeed,
            out bool limitIsMultiplier,
            bool finalDestination = false)
        {
            FormationMovementComponent component = agent.GetComponent <FormationMovementComponent>();

            if (component != null)
            {
                return(component.GetFormationFrame(out formationPosition, out formationDirection, out speedLimit, out isSettingDestinationSpeed, out limitIsMultiplier, finalDestination));
            }
            formationPosition         = WorldPosition.Invalid;
            formationDirection        = Vec2.Invalid;
            speedLimit                = -1f;
            isSettingDestinationSpeed = false;
            limitIsMultiplier         = false;
            return(false);
        }