//public ObjectiveData objective; private void OnReach() { objectiveList = GameObject.Find("Objectives").GetComponent <ObjectivesList>(); if (ActionsOnReach.Contains(ActionOnReach.MarkAsAchieved)) { Debug.Log(this.name); Debug.Log(this.TargetName); //GameObject.Find(this.name).GetComponent<Objective>().Status = ObjectiveStatus.Achieved; objectiveList.toggleCompleteObjective(this.name, true); Status = ObjectiveStatus.Achieved; } if (ActionsOnReach.Contains(ActionOnReach.PlayCinematic)) { this.PlayCinematic(); } if (ActionsOnReach.Contains(ActionOnReach.PlayAnimation)) { this.PlayAnimation(); } if (ActionsOnReach.Contains(ActionOnReach.SetTrigger)) { Debug.Log("trigger something"); } //this.NextObjective.Target.GetComponentInParent<Animator>().SetTrigger(this.TriggerName); ParentScript.CurrentObjective = NextObjective; //objectiveList.WriteFile("", objectiveList.playerObjectiveList); }
// Start is called before the first frame update void Start() { parentRect = new Rect(currentDialog.position.x, currentDialog.position.y, currentDialog.size.x, currentDialog.size.y); gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); inventoryManager = GameObject.Find("InventoryManager").GetComponent <InventoryManager>(); objectivesList = GameObject.Find("Objectives").GetComponent <ObjectivesList>(); }
// Start is called before the first frame update void Start() { Scene scene = SceneManager.GetActiveScene(); gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); spawnManager = GameObject.Find("SpawnManager").GetComponent <SpawnManager>(); objectiveList = GameObject.Find("Objectives").GetComponent <ObjectivesList>(); inventoryManager = GameObject.Find("InventoryManager").GetComponent <InventoryManager>(); characterManager = GameObject.Find("CharacterManager").GetComponent <CharacterManager>(); gameManager.gameStarted = gameStarted; GameObject.Find("UIManager").GetComponent <ObjectiveUI>().showUI = showObjectiveUI; //objectiveList.objectiveList.RemoveAll() //objectiveList = GameObject.Find("Objectives").GetComponent<ObjectivesList>(); //objectiveList.objectiveList = GameObject.FindGameObjectsWithTag("Objective"); //objectiveList.loadObjectives = true; // objectiveList.WriteFile(); //objectiveList.ReadFile(); gameManager.enabled = true; GameObject.Find("UIManager").GetComponent <SelectionUI>().enabled = true; spawnManager.SpawnPoints = GameObject.FindGameObjectsWithTag("SpawnPoint"); if (gameManager.playerLocation != locationType.Building) { if (GameObject.FindWithTag("MainCamera").GetComponent <Skybox>() != null) { GameObject.FindWithTag("MainCamera").GetComponent <Skybox>().material = gameManager.spaceSkybox; } //Resources.Load<Material>("/Assets/SkyBox/GalaxySkyBox"); } if (gameManager.playerLocation == locationType.Building) { if (GameObject.FindWithTag("MainCamera").GetComponent <Skybox>() != null) { GameObject.FindWithTag("MainCamera").GetComponent <Skybox>().material = Resources.Load <Material>("None"); } } //Debug.Log(scene.name + " " + gameManager.spawnName); gameManager.updateTargets = true; //gameManager GameObject.Find("GameManager").GetComponent <GameManager>()._SpawnPlayer(); StartCoroutine(load()); //GameObject.Find("UIManager").GetComponent<SelectionUI>().FindSelectionObjects(); }
void _addAllTheBasesAsObjectives() { for (int i = 0; i < playerFunctions.ListOfSpawnPoints.Count; i++) { if (i == playerFunctions.ThisTeamID.TeamIDNumber) { Objective objective = new Objective(); objective.TargetObject = playerFunctions.ListOfSpawnPoints[i]; HomeBase = objective.TargetObject; objective.Name = "Patrol"; ObjectivesList.Add(objective); } else { Objective objective = new Objective(); objective.TargetObject = playerFunctions.ListOfSpawnPoints[i]; objective.Name = "CaptureFlag"; ObjectivesList.Add(objective); } } }
void Awake() { objectives = GameObject.Find("Objectives").GetComponent <ObjectivesList>(); uiManager = GameObject.Find("UIManager").GetComponent <UIPlacement>(); //DontDestroyOnLoad(this.gameObject); }