/* public bool filmDelaying = false; public bool canceled = false; */ public Objective(string nameGameobject, float baseScore, float timeToFilmInSeconds, ObjectiveList list) { _nameObjectToFilm = nameGameobject; _baseScoreObject = baseScore; _timeToFilmInSeconds = timeToFilmInSeconds; list.AddedObjective (this); }
//public GameObject Green; // if (stepOnThis == "<color>" && <color>On == true) { advance script/ thisStep++ } //Red, Green, Blue, Red, Yellow //Y,B,R,G,R2,Y2,B2,R3,B3,G2 // Use this for initialization void Start() { ninja = GameObject.FindObjectOfType <ObjectiveList>(); ThatsMyJam = GetComponent <AudioSource>(); stepOnThis = "End"; }
/// <summary> /// Replaces current objectives list with new list. /// </summary> /// <returns><c>true</c>, if objectives list was replaced, <c>false</c> otherwise.</returns> /// <param name="lst">Objective list.</param> public static bool ReplaceObjectivesList(ObjectiveList lst) { try { objList = lst; MakeChildrenConnections(); return(true); } catch (Exception e) { Debug.LogError(e.Message); return(false); } }
/// <summary> /// Adds the objectives from file. /// To be used for adding new objectives from a file while preserving the current objectives state. /// </summary> /// <returns><c>true</c>, if objectives from file was added, <c>false</c> otherwise.</returns> /// <param name="filePath">File path to load from.</param> public static bool AddObjectivesFromFile(string filePath) { ObjectiveList lst = FileHandler.ReadFile <ObjectiveList> (filePath); if (lst == null) { Debug.LogError("Could Not Load File"); return(false); } return(AppendObjectivesList(lst)); }
/// <summary> /// Loads the state of the objectives from an external xml file. /// Will replace current objectives state with new one. /// </summary> /// <returns><c>true</c>, if objectives state was loaded, <c>false</c> otherwise.</returns> /// <param name="filePath">File path to load from.</param> public static bool LoadObjectivesState(string filePath = defaultSavePath) { ObjectiveList lst = FileHandler.ReadFile <ObjectiveList> (filePath); if (lst == null) { Debug.LogError("Could Not Load File"); return(false); } return(ReplaceObjectivesList(lst)); }
// Use this for initialization void Start() { Blue.GetComponent <Renderer>().material.color = Color.black; Yellow.GetComponent <Renderer>().material.color = Color.black; Green.GetComponent <Renderer>().material.color = Color.black; //Red.GetComponent<Renderer>().material.color = Color.black; ninja = GameObject.FindObjectOfType <ObjectiveList>(); /* * Blue.GetComponent<Renderer>().material.color = Color.blue; * Yellow.GetComponent<Renderer>().material.color = Color.yellow; * Green.GetComponent<Renderer>().material.color = Color.green; * Red.GetComponent<Renderer>().material.color = Color.red; */ }
/// <summary> /// Appends new objectives list to current list. /// </summary> /// <returns><c>true</c>, if objectives list was appended, <c>false</c> otherwise.</returns> /// <param name="lst">Objective list.</param> /// <param name="avoidRepeats">If true, will not add objectives already in the list.</param> public static bool AppendObjectivesList(ObjectiveList lst, bool avoidRepeats = true) { try { for (int i = 0; i < lst.list.Count; i++) { if (!avoidRepeats || !objList.list.Contains(lst.list [i])) { objList.list.Add(lst.list [i]); } } MakeChildrenConnections(); return(true); } catch (Exception e) { Debug.LogError(e.Message); return(false); } }
/// <summary> /// Initializes a new instance of the <see cref="StorageContainer"/> class. /// </summary> public StorageContainer() { // Player Info GameObject player = GameObject.FindGameObjectWithTag("Player"); Transform playerTrans = player.transform; Vector3 p_pos = playerTrans.position; Quaternion p_rot = playerTrans.rotation; Vector3 p_scale = playerTrans.localScale; // Level Info string sceneName = SceneManager.GetActiveScene().name; PlayerPos = new float[] { p_pos.x, p_pos.y, p_pos.z }; PlayerRot = new float[] { p_rot.x, p_rot.y, p_rot.z, p_rot.w }; PlayerScale = new float[] { p_scale.x, p_scale.y, p_scale.z }; SceneName = sceneName; objList = ObjectiveManager.GetList(); }
// public List<Color> Colors1 = new List<Color>(); // Use this for initialization void Start() { doorAnim = DoorPhyF.GetComponent <Animator>(); // gameObject.renderer.material.color = Color.white; DoorLight.GetComponent <Renderer>().material.color = Color.black; //DDR1.GetComponent ninja = GameObject.FindObjectOfType <ObjectiveList>(); ThatsMyJam = GetComponent <AudioSource>(); /* * * if (GameObject.Find("name of the gameobject holding the script with the bool").GetComponent<name of the script holding the bool>().IsLightOn) //will check if true * * if (!GameObject.Find("name of the gameobject holding the script with the bool").GetComponent<name of the script holding the bool>().IsLightOn) //will check if false * */ }
// Use this for initialization void Start() { ninja = GameObject.FindObjectOfType <ObjectiveList>(); }
void Start() { objList = GameObject.Find ("GameController").GetComponent<ObjectiveList>(); objList.ObjectiveFinished += ObjectiveFinished; }