コード例 #1
0
ファイル: PlayerController.cs プロジェクト: harhal19/Branch
 public void SetAnomalObjectMode(AnomalObject anomalObject)
 {
     ResetMode();
     CameraControl.MainCamera.Free();
     PlacingObject = anomalObject;
     AnomalObjectUI.FirstUI.SetAnomalObject(anomalObject);
     CurrentMode = ControlMode.AnomalObjectControl;
     GridComponent.grid.HighLightFreeStorages();
 }
コード例 #2
0
 public void SetAnomalObject(AnomalObject anomalObject)
 {
     this.AnomalObject = anomalObject;
     gameObject.SetActive(true);
     if (anomalObject.Storage == null)
     {
         SwitchToMoveMode();
     }
     else
     {
         SwitchToInfoMode();
     }
     RefreshData();
     //transform.SetParent(parentCanvas, false);
 }
コード例 #3
0
 public void Open()
 {
     if (Target is Building)
     {
         if (SessionData.Data.BranchBase.BuildingsList.Contains(Target as Building))
         {
             PlayerController.MainController.SetBuildingControlMode(Target as Building);
         }
     }
     if (Target is Vector3)
     {
         PlayerController.MainController.SetDefaultMode();
         CameraControl.MainCamera.Destination = (Vector3)Target;
     }
     if (Target is AnomalObject)
     {
         AnomalObject anomalObject = Target as AnomalObject;
         if (SessionData.Data.Warehouse.AnomalObjects.ContainsKey(anomalObject.ID))
         {
             if (anomalObject.Storage != null)
             {
                 PlayerController.MainController.SetBuildingControlMode(anomalObject.Storage);
             }
             else
             {
                 PlayerController.MainController.SetAnomalObjectMode(anomalObject);
             }
         }
     }
     if (Target is Report)
     {
         PlayerController.MainController.ShowReport(Target as Report);
     }
     if (Target is Human)
     {
         PlayerController.MainController.ShowHuman(Target as Human);
     }
     if (Target is string)
     {
         PlayerController.MainController.ShowMessage(Target as string);
     }
     Read();
 }
コード例 #4
0
 public void Research(ImpactFactors Researches, AnomalObject ResearchedObject)
 {
     ResearchesProgress += Researches;
     for (int i = 0; i < ImpactFactors.FieldsCount; i++)
     {
         if (i != 6)
         {
             if (ResearchedTechs[i] >= ImpactFactors.MaxValue)
             {
                 ResearchesProgress[i] = 0;
                 ResearchedTechs[i]    = ImpactFactors.MaxValue;
             }
             if (ResearchesProgress[i] > GameData.Data.LevelsData.GetResearchesPointsToNextLevel((int)ResearchedTechs[i]))
             {
                 ResearchesProgress[i]         = ResearchesProgress[i] - GameData.Data.LevelsData.GetResearchesPointsToNextLevel((int)ResearchedTechs[i]);
                 ResearchedObject.Description += '\n' + GameData.Data.LevelsData.GetDiscoveryDescription(i, (int)ResearchedTechs[i]);
                 Kanban.Board.ResearchesUpdated("New technogy discovered", ResearchedObject);
                 ResearchedTechs[i]++;
             }
         }
     }
 }
コード例 #5
0
ファイル: PlayerController.cs プロジェクト: harhal19/Branch
 public bool IsAnomalObjectSelected(AnomalObject anomalObject)
 {
     return(PlacingObject == anomalObject);
 }