示例#1
0
    private void Start()
    {
        islands = new List <Transform>();
        enemies = new List <Transform>();
        menuSet = FindObjectOfType <MenuSettings>();
        if (menuSet == null || menuSet.isRandom)
        {
            int f = Random.Range(0, 3);
            switch (f)
            {
            case 0:
                mapToLoad = MapType.goal;
                break;

            case 1:
                mapToLoad = MapType.kill;
                break;

            default:
                mapToLoad = MapType.survive;
                break;
            }
        }
        else
        {
            mapToLoad = menuSet.mapType;
        }
        objControl = GetComponent <ObjectiveController>();
        CreateMap();
    }
 public PlanetDetailsLargeObjectivesViewModule(PlanetDetailsScreen screen)
 {
     this.tempTimeString = string.Empty;
     base..ctor(screen);
     this.player = Service.Get <CurrentPlayer>();
     this.objectiveController = Service.Get <ObjectiveController>();
     this.lang = Service.Get <Lang>();
 }
    // Use this for initialization
    void Start()
    {
        objective = Objective.GetInstance();
        dropdown.AddItems(objective.GetIndividualObjectives().ToArray());
        dropdown.HideFirstItem       = false;
        dropdown.OnSelectionChanged += (int index) => {
            updateInput(index);
        };

        objectiveControllerInstance = this;
    }
 void Awake()
 {
     NotificationController  = NotificationObject.GetComponent <NotificationController>();
     ObjectiveController     = ObjectiveObject.GetComponent <ObjectiveController>();
     ElectricCableController = ElectricCable.GetComponent <ElectricCableController>();
     AirlockDoorController   = AirlockOuterDoor.GetComponent <AirlockDoorController>();
     VoiceLines = GetComponent <AudioSource>();
     AirlockPressurisationController = AirlockTrigger.GetComponent <AirlockPressurisationController>();
     FabricatorController            = FabricatorTrigger.GetComponent <FabricatorController>();
     PlayerStats = GetComponent <PlayerStats>();
     BeaconLocationController = GetComponent <BeaconLocationController>();
     RescueController         = GetComponent <RescueController>();
 }
示例#5
0
    private void SetCorrectObjective()
    {
        if (ObjectiveController)
        {
            ObjectiveController.DeletObjective();
            ObjectiveController = null;
        }

        if (ObjectiveType == ObjectiveType.Empty)
        {
            return;
        }

        ObjectiveController      = TileParent.gameObject.AddComponent <ObjectiveController>();
        ObjectiveController.Type = ObjectiveType;
    }
示例#6
0
 public void OnScreenLoaded()
 {
     this.objectiveController   = Service.ObjectiveController;
     this.objectivesPanel       = this.screen.GetElement <UXElement>("Objectives");
     this.labelOperationsLocked = this.screen.GetElement <UXLabel>("LabelOperationsLocked");
     if (!this.objectiveController.ShouldShowObjectives())
     {
         this.objectivesPanel.Visible = false;
         return;
     }
     this.objectiveController       = Service.ObjectiveController;
     this.labelObjectivesTitle      = this.screen.GetElement <UXLabel>("LabelObjectivesTitle");
     this.labelObjectivesTitle.Text = Service.Lang.Get("OBJECTIVES", new object[0]);
     this.labelObjectivesTimer      = this.screen.GetElement <UXLabel>("LabelObjectivesTimer");
     this.btnDetails                       = this.screen.GetElement <UXButton>("BtnObjectiveDetails");
     this.btnDetails.OnClicked             = new UXButtonClickedDelegate(this.OnObjectivesDetailsClicked);
     this.labelBtnDetails                  = this.screen.GetElement <UXLabel>("LabelBtnDetails");
     this.labelBtnDetails.Text             = this.lang.Get("objective_details", new object[0]);
     this.containerJewelObjectives         = this.screen.GetElement <UXElement>("ContainerJewelObjectives");
     this.containerJewelObjectives.Visible = false;
     this.specialObjectiveIcon             = this.screen.GetElement <UXTexture>("TextureObjectiveSpecial");
     this.specialObjectiveFrame            = this.screen.GetElement <UXTexture>("TextureObjectiveFrameSpecial");
     this.specialObjectiveIcon.Visible     = false;
     this.specialObjectiveFrame.Visible    = false;
     for (int i = 0; i < 3; i++)
     {
         ObjectiveViewData objectiveViewData = new ObjectiveViewData();
         this.data.Add(objectiveViewData);
         string text = (i + 1).ToString();
         objectiveViewData.BtnSupplyCrate           = this.screen.GetElement <UXButton>("BtnSupplyCrate" + text);
         objectiveViewData.SpriteCheckmark          = this.screen.GetElement <UXSprite>("SpriteCheckmark" + text);
         objectiveViewData.SpritePreview            = this.screen.GetElement <UXSprite>("SpriteSupplyCrate" + text);
         objectiveViewData.RadialProgress           = this.screen.GetElement <UXSprite>("SpriteObjectiveProgress" + text);
         objectiveViewData.ObjectiveBgComplete      = this.screen.GetElement <UXElement>("CrateBgComplete" + text);
         objectiveViewData.ObjectiveBgActive        = this.screen.GetElement <UXElement>("CrateBgProgress" + text);
         objectiveViewData.ObjectiveBgExpired       = this.screen.GetElement <UXElement>("CrateBgExpired" + text);
         objectiveViewData.ObjectiveBgCollected     = this.screen.GetElement <UXElement>("CrateBgCollected" + text);
         objectiveViewData.SpecailObjectiveFx       = this.screen.GetElement <UXElement>("CrateEffect" + text);
         objectiveViewData.BtnSupplyCrate.OnClicked = new UXButtonClickedDelegate(this.OnPreviewIconClicked);
         objectiveViewData.BtnSupplyCrate.Tag       = objectiveViewData;
         objectiveViewData.ExpiredLabel             = this.screen.GetElement <UXLabel>("LabelObjectiveExpired" + text);
         objectiveViewData.ObjectiveContainer       = this.screen.GetElement <UXElement>("ContainerCrateBgProgress3");
         objectiveViewData.ObjectiveContainerLEI    = ((!(text == "3")) ? this.screen.GetElement <UXElement>("ContainerCrateBgProgress3") : this.screen.GetElement <UXElement>("ContainerCrateBgProgressSpecial3"));
     }
     Service.ViewTimeEngine.RegisterClockTimeObserver(this, 1f);
     this.RefreshScreenForPlanetChange();
 }
示例#7
0
    public void CreateNewRadar(bool isEnemy, Transform target, ObjectiveController objc)
    {
        if (objControl == null)
        {
            objControl = objc;
        }
        GameObject prefab;

        if (isEnemy)
        {
            prefab = enemyRadarPrefab;
        }
        else
        {
            prefab = goalRadarPrefab;
        }
        GameObject obj = Instantiate(prefab, transform.position, prefab.transform.rotation);

        obj.transform.SetParent(radarParent);
        obj.GetComponent <RadarRotate>().target = target;
    }
    private void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        StartBlinking();

        allObjectives     = new Dictionary <string, Objective>();
        currentObjectives = new List <Objective>();

        StartCoroutine(InitialNotificationDelayed());

        if (SceneManager.GetActiveScene().name == "MainNew")
        {
            AddObjectivesForNewGame();
        }
        else
        {
            AddObjectivesForLoadGame();
        }
    }
 // Awake.
 private void Awake()
 {
     Instance = this;
 }
示例#10
0
 public PlanetDetailsLargeObjectivesViewModule(PlanetDetailsScreen screen) : base(screen)
 {
     this.player = Service.CurrentPlayer;
     this.objectiveController = Service.ObjectiveController;
     this.lang = Service.Lang;
 }
示例#11
0
 void Awake()
 {
     instance = this;
 }
示例#12
0
 // Start is called before the first frame update
 void Start()
 {
     objControl = GetComponent <ObjectiveController>();
     barrelsUI  = barrelsParent.GetComponent <UIList>();
     skullsUI   = skullsParent.GetComponent <UIList>();
 }
    public void LoadEnvironmentVariables()
    {
        Dictionary <string, System.Object> variables = environmentVariableDAO.LoadOne();

        Dictionary <string, System.Object> globalSettings = (Dictionary <string, System.Object>)variables["GlobalSettings"];
        Dictionary <string, System.Object> turnManager    = (Dictionary <string, System.Object>)variables["TurnManager"];
        Dictionary <string, System.Object> weather        = (Dictionary <string, System.Object>)variables["Weather"];
        List <System.Object> teams = (List <System.Object>)variables["Teams"];
        Dictionary <string, System.Object> objectives = (Dictionary <string, System.Object>)variables["Objective"];

        GlobalSettings.SetHealthThresholdForHalfMovement(Convert.ToSingle(globalSettings["half_movement"]));
        GlobalSettings.SetHealthThresholdForNoAircraftLaunching(Convert.ToSingle(globalSettings["no_aircraft"]));
        GlobalSettings.SetHealthThresholdForNoDetectors(Convert.ToSingle(globalSettings["no_detector"]));
        GlobalSettings.SetHealthThresholdForNoMovement(Convert.ToSingle(globalSettings["no_movement"]));
        GlobalSettings.SetHealthThresholdForNoWeapons(Convert.ToSingle(globalSettings["no_weapons"]));
        GlobalSettings.SetRetaliationPercentChance(Convert.ToSingle(globalSettings["retaliation_p"]));
        GlobalSettings.SetRetaliationDamage(Convert.ToSingle(globalSettings["retaliation_d"]));
        GlobalSettings.SetCurrentWeatherIndex(Convert.ToInt32(globalSettings["w_index"]));

        TurnManager.TurnCount = Convert.ToInt32(turnManager["count"]);

        foreach (string key in weather.Keys)
        {
            //Debug.Log(key);
            Dictionary <string, System.Object> singleItem = (Dictionary <string, System.Object>)weather[key];

            int index = Convert.ToInt32(singleItem["index"]);

            string type = key;

            float movement;
            float visibility;
            try{
                movement = Convert.ToSingle(singleItem["movement"]);
            }
            catch (InvalidCastException e) {
                //Debug.Log(singleItem["movement"]);
                int moveInt = Convert.ToInt32(singleItem["movement"]);
                movement = (float)moveInt;
            }

            try{
                visibility = Convert.ToSingle(singleItem["visibility"]);
            }
            catch (InvalidCastException e) {
                int visInt = Convert.ToInt32(singleItem["visibility"]);
                visibility = (float)visInt;
            }

            //if(Weather.WeatherTypes == null) {
            Weather.WeatherTypes = new Dictionary <int, Weather>();
            //}

            Weather.WeatherTypes.Add(index, new Weather(type, movement, visibility));
        }

        Team.ClearTeams();
        foreach (System.Object team in teams)
        {
            Dictionary <string, System.Object> singleItem = (Dictionary <string, System.Object>)team;

            try
            {
                Team toAdd = new Team((string)singleItem["team_name"], Convert.ToInt32(singleItem["index"]));
                if (!toAdd.GetTeamName().Equals("default"))
                {
                    Color teamColor = new Color((float)Convert.ToDecimal(singleItem["red"]),
                                                (float)Convert.ToDecimal(singleItem["green"]),
                                                (float)Convert.ToDecimal(singleItem["blue"]));
                    toAdd.SetTeamColor(teamColor);
                    Team.addTeamAtIndex(toAdd, Convert.ToInt32(singleItem["index"]));
                }
            }
            catch (ArgumentException) {}
        }

        Objective.GetInstance().SetObjective((string)objectives["text"]);

        List <System.Object> toTranslate = (List <System.Object>)objectives["ind"];
        List <string>        toSet       = new List <string>();

        foreach (System.Object toAdd in toTranslate)
        {
            Dictionary <string, System.Object> item = (Dictionary <string, System.Object>)toAdd;
            toSet.Add((string)item["value"]);
        }


        Objective.GetInstance().SetIndividualObjectives(toSet);
        ObjectiveController.GetInstance().UpdateDropDown();
    }
示例#14
0
 private void Start()
 {
     c_objectives = GetComponent <ObjectiveController>();
     c_eventText  = GetComponent <EventTextController>();
 }