public void PerformFunction() { Debug.Log("test"); CommanderController commander = Camera.main.transform.parent.GetComponent <CommanderController>(); if (functionNum == 1) { commander.SpawnMinion(); } else if (functionNum == 2) { commander.SpawnFighter(); } else if (functionNum == 3) { commander.UpgradeHealth(); } else if (functionNum == 4) { commander.UpgradeSpeed(); } else if (functionNum == 5) { commander.UpgradeDamage(); } else if (functionNum == 6) { commander.RepairBase(); } }
/// <summary> /// This fires when a product is successfully read from the message /// </summary> /// <param name="currentLineNumber">The current line number.</param> /// <param name="fields">The fields.</param> /// <param name="lineText">The line text.</param> private void RecordFound(ref int currentLineNumber, TextFieldCollection fields, string lineText) { string type; string subType; GetRowTypeAndSubType(lineText, out type, out subType); if (type == GetItemType() && subType == GetSubItemType()) //add { //get commander product by product code string productCode = fields["ProductCode"].Value.ToString().Trim(); if (string.IsNullOrEmpty(site)) { site = fields["Site"].Value.ToString().Trim(); } CommanderProduct commanderProduct = CommanderController.GetProduct(productCode); if (commanderProduct == null) //there is no matching HSPG product in our product list { hspgItems.Add(lineText); } else { tpcItems.Add(lineText); } } else if (type == HeaderOrFooter && subType == "L") //footer { footerLine = lineText; } else if (type == HeaderOrFooter && subType == "F") //header { headerLine = lineText; } }
void DrawRadii(string cmd, string[] splitcmd, int player) { Float3 commanderpos = CommanderController.GetInstance().GetCommanderPos(); for (int i = 100; i <= 1000; i += 100) { DrawingUtils.DrawCircle(commanderpos, i); } }
//Custom Methods //Finds the commander controller that is attributed to the player private void FindPlayerCommanderController() { //Makes a list of all commander controllers foreach (CommanderController controller in new List <CommanderController>(FindObjectsOfType <CommanderController>())) { //Selects the Commander Controller owned by the player if (controller.gameObject.tag == "Player") { playerCommanderController = controller; } } }
private void FindCommanderController() { UnityEngine.Debug.Log("I know to look for a commander controller"); foreach (CommanderController controller in FindObjectsOfType <CommanderController>()) { UnityEngine.Debug.Log(controller); if (controller.GetCommanderTag() == ownerTag) { commanderController = controller; baseMaterial = commanderController.GetMainBaseMaterial(); upgradeTowerMaterial = commanderController.GetUpgradeTowerMaterial(); } } }
public void SetDetails(CommanderController commander, int unitId, float maxHealth, float attackPwr, float attackMod) { Commander = commander; UnitId = unitId; MaxHealth = maxHealth; AttackPower = attackPwr; AttackModifier = attackMod; Name = "Phantom_" + Random.Range(1, 1000); myType = (UnitType)Random.Range(0, 5); if (Commander.Base.CommandHUB != null) { Commander.Base.CommandHUB.UniCamSwitch.notificationController.SendNotification(Name + " has been created!", NotificationSprites.Build, Color.cyan); } }
/// <summary> /// Saves the commander orders. /// </summary> /// <param name="requestMessage">The request message.</param> /// <returns></returns> private SubscriberStatusEnum SaveCommanderOrders(RequestMessage requestMessage) { foreach (CommanderSalesOrder salesOrder in salesOrders) { //check to see if a commander order already exists for this order reference CommanderSalesOrder previousRecord = CommanderController.GetSalesOrder(salesOrder.OrderReference, false); if (previousRecord != null) { //check to see if the related shipment exists and if it has been sent to the warehouse yet TDCShipment relatedShipment = TDCShipmentController.GetShipment(requestMessage.SourceSystem, previousRecord.OrderReference, "NA"); if (relatedShipment != null) { if (Null.NullDate != relatedShipment.SentToWMS) { ////log //LogEntry logEntry=new LogEntry(); //logEntry.Message = "blah"; //Logger.Write(logEntry); // throw new Exception("This message has already been sent to the warehouse."); return(SubscriberStatusEnum.Processed); } } salesOrder.Id = previousRecord.Id; foreach (CommanderSalesOrderLine commanderSalesOrderLine in salesOrder.Lines) { commanderSalesOrderLine.CommanderSalesOrderId = previousRecord.Id; } } //save salesOrder and lines try { int savedId = CommanderController.SaveSalesOrder(salesOrder, true); } catch (InValidBusinessObjectException ex) { //log exception } } return(SubscriberStatusEnum.Processed); }
public override bool OnLobbyServerSceneLoadedForPlayer(GameObject lobbyPlayer, GameObject gamePlayer) { Debug.Log("Setting up Player"); LobbyPlayer lPlayer = lobbyPlayer.GetComponent <LobbyPlayer>(); if (lPlayer.role == 0 || lPlayer.role == 4) { CommanderController gPlayer = gamePlayer.GetComponent <CommanderController>(); if (lPlayer.role < 4) { gPlayer.team = 0; gamePlayer.transform.position = new Vector3(0, 0, -110); } else { gPlayer.team = 1; gamePlayer.transform.position = new Vector3(0, 0, 110); } } else { FpsPlayerController gPlayer = gamePlayer.GetComponent <FpsPlayerController>(); Debug.Log(gPlayer); if (lPlayer.role < 4) { gPlayer.team = 0; gPlayer.GetComponent <MeshRenderer>().material.color = Color.red; gPlayer.GetComponent <NavMeshAgent>().Warp(new Vector3((lPlayer.role - 2) * 5, 9, -110)); } else { gPlayer.team = 1; gPlayer.GetComponent <MeshRenderer>().material.color = Color.blue; gPlayer.GetComponent <NavMeshAgent>().Warp(new Vector3((lPlayer.role - 6) * 5, 9, 110)); gPlayer.transform.Rotate(0, 180, 0); } } return(true); }
/// <summary> /// Saves the commander orders. /// </summary> /// <param name="requestMessage">The request message.</param> /// <returns></returns> private SubscriberStatusEnum SaveProducts(RequestMessage requestMessage) { foreach (CommanderProduct product in products) { if (product.IsUpdate) { //this should be an update so check to see if this record already exists CommanderProduct previousRecord = CommanderController.GetProduct(product.ProductCode); if (previousRecord != null) { //the record did not exist so log an exception ////log //LogEntry logEntry=new LogEntry(); //logEntry.Message = "blah"; //Logger.Write(logEntry); // throw new Exception("This message has already been sent to the warehouse."); return(SubscriberStatusEnum.Processed); } product.Id = previousRecord.Id; } //save salesOrder and lines try { int savedId = CommanderController.SaveProduct(product); } catch (InValidBusinessObjectException ex) { //log exception return(SubscriberStatusEnum.Failed); } } return(SubscriberStatusEnum.Processed); }
//Sets the CommanderCOntroller that matches the AI public void SetCommanderController(CommanderController controller) { commanderController = controller; }
// Start is called before the first frame update void Start() { player = GameObject.Find("PlayerController"); commanderController = player.GetComponent <CommanderController>(); }