예제 #1
0
    public void AddFeedbackForOrder(RegisteredCmderOrder order)
    {
        if (order.orderType == RegisteredCmderOrder.OrderType.createCmder ||
            order.orderType == RegisteredCmderOrder.OrderType.move)
        {
            Zone targetZone = null;
            if (order.zoneTargetID != -1)
            {
                targetZone = GameController.GetZoneByID(order.zoneTargetID);
                if (targetZone == null)
                {
                    return;
                }
            }

            if (order.orderType == RegisteredCmderOrder.OrderType.createCmder)
            {
                WorldVisualFeedbacks.instance.createCmderFBCycler.PlaceObjAt(targetZone.MyZoneSpot.transform);
            }
            else
            {
                Commander targetCmder = GameController.GetCmderByID(order.orderedActorID);
                if (targetCmder == null)
                {
                    return;
                }

                Faction ownerFac = GameController.GetFactionByID(targetCmder.ownerFaction);
                if (ownerFac == null)
                {
                    return;
                }

                LinkLine line = WorldVisualFeedbacks.instance.moveFBCycler.GetAnObj().GetComponent <LinkLine>();
                line.SetLink(targetCmder.MeIn3d, targetZone.MyZoneSpot, ownerFac.color, 0.3f);
            }
        }
        else
        {
            Commander targetCmder = GameController.GetCmderByID(order.orderedActorID);
            if (targetCmder == null)
            {
                return;
            }

            if (order.orderType == RegisteredCmderOrder.OrderType.recruit)
            {
                WorldVisualFeedbacks.instance.recruitFBCycler.PlaceObjAt(targetCmder.MeIn3d.transform);
            }
            else
            {
                WorldVisualFeedbacks.instance.trainingFBCycler.PlaceObjAt(targetCmder.MeIn3d.transform);
            }
        }
    }
예제 #2
0
    public static void PlaceZoneLink(Zone z1, Zone z2, bool alsoUpdateTheirLinkedList = false)
    {
        LinkLine theLink = LinkLineRecycler.GetALine();

        theLink.SetLink(z1.MyZoneSpot, z2.MyZoneSpot);
        instance.linkLines.Add(theLink);
        if (alsoUpdateTheirLinkedList)
        {
            z1.linkedZones.Add(z2.ID);
            z2.linkedZones.Add(z1.ID);
        }
    }
예제 #3
0
    public static void PlaceZoneLink(ZoneSpot zs1, ZoneSpot zs2, bool alsoUpdateTheirLinkedList = false)
    {
        LinkLine theLink = LinkLineRecycler.GetALine();
        Zone     z1 = zs1.data as Zone, z2 = zs2.data as Zone;

        theLink.SetLink(zs1, zs2);
        instance.linkLines.Add(theLink);
        if (alsoUpdateTheirLinkedList)
        {
            z1.linkedZones.Add(z2.ID);
            z2.linkedZones.Add(z1.ID);
        }
    }