Example #1
0
 public void HandleSelectedChange()
 {
     if (Agent.Controller.Commander == PlayerManager.MainController.Commander)
     {
         RallyPoint flag = PlayerManager.MainController.Commander.GetComponentInChildren <RallyPoint>();
         if (Agent.IsSelected)
         {
             if (flag && spawnPoint != ResourceManager.InvalidPosition && rallyPoint != ResourceManager.InvalidPosition)
             {
                 if (_flagState == FlagState.FlagSet)
                 {
                     flag.transform.localPosition = rallyPoint.ToVector3();
                     flag.transform.forward       = transform.forward;
                     flag.Enable();
                 }
                 else
                 {
                     flag.transform.localPosition = Agent.Body.Position3d.ToVector3();
                     flag.Disable();
                 }
             }
         }
         else
         {
             if (flag)
             {
                 flag.Disable();
             }
         }
     }
 }
    public override void SetSelection(bool selected, Rect playingArea)
    {
        base.SetSelection(selected, playingArea);

        if (player)
        {
            RallyPoint flag = player.GetComponentInChildren <RallyPoint>();
            if (selected)
            {
                if (flag && player.human && spawnPoint != ResourceManager.InvalidPosition && rallyPoint != ResourceManager.InvalidPosition)
                {
                    flag.transform.localPosition = rallyPoint;
                    flag.transform.forward       = transform.forward;
                    flag.Enable();
                }
            }
            else
            {
                if (flag && player.human)
                {
                    flag.Disable();
                }
            }
        }
    }
Example #3
0
    protected override void Update()
    {
        base.Update();

        if (player && hasSpawnPoint)
        {
            RallyPoint rallyPt = player.GetComponentInChildren <RallyPoint>();
            if (selected)
            {
                if (rallyPt && player.isHuman && spawnPoint != null && rallyPoint != null)
                {
//					rallyPt.transform.position = rallyPoint;
//					rallyPt.transform.forward = transform.forward;
                    rallyPt.Enable();
                }
            }
            else
            {
                if (rallyPt && player.isHuman)
                {
                    rallyPt.Disable();
                }
            }
        }

        ProcessBuildQueue();
    }
Example #4
0
 public void SetRallyPoint(Vector3d position)
 {
     rallyPoint = position;
     if (PlayerManager.MainController.Commander && Agent.IsSelected)
     {
         RallyPoint flag = PlayerManager.MainController.Commander.GetComponentInChildren <RallyPoint>();
         if (flag)
         {
             if (!flag.ActiveStatus)
             {
                 flag.Enable();
             }
             flag.transform.localPosition = rallyPoint.ToVector3();
             _flagState = FlagState.FlagSet;
         }
     }
 }
Example #5
0
    protected override void Update()
    {
        base.Update();

        if (player.isLocalPlayer && hasSpawnPoint)
        {
            if (selected && spawnPoint != null && rallyPoint != null)
            {
                rallyPtObj.Enable();
            }
            else
            {
                rallyPtObj.Disable();
            }
        }

//		ProcessBuildQueue();
    }
 public void SetRallyPoint(Vector3 position)
 {
     rallyPoint = position;
     if (Agent.GetCommander() && Agent.IsSelected)
     {
         RallyPoint flag = Agent.GetCommander().GetComponentInChildren <RallyPoint>();
         if (flag)
         {
             if (!flag.ActiveStatus)
             {
                 flag.Enable();
             }
             flag.transform.localPosition = rallyPoint;
             _flagState = FlagState.FlagSet;
             Agent.Controller.GetCommanderHUD().SetCursorLock(false);
             Agent.Controller.GetCommanderHUD().SetCursorState(CursorState.Select);
             SelectionManager.SetSelectionLock(false);
         }
     }
 }