public bool Equals(CustomCommandData other) { if (ReferenceEquals(other, null)) { return(false); } if (ReferenceEquals(other, this)) { return(true); } if (other.CustomCommandAttempted != CustomCommandAttempted) { return(false); } if (other.CustomCommandSucceeded != CustomCommandSucceeded) { return(false); } if (other.CustomCommandLatencyMs != CustomCommandLatencyMs) { return(false); } return(true); }
public void SetAttemptedCustomCommand(bool attempted) { var customCommand = new CustomCommandData { CustomCommandAttempted = attempted }; RecordCustomCommandData(customCommand); }
public static CustomCommand CreateCustomCommand(CustomCommandData data, Vector3 position, Quaternion rotation) { GameObject prefab = Resources.Load <GameObject>(prefabPaths[data.type]); GameObject mainCanvas = GameObject.FindGameObjectWithTag("MainCanvas"); GameObject go = GameObject.Instantiate(prefab, position, rotation) as GameObject; CustomCommand customCommand = go.GetComponent <CustomCommand>() ?? go.AddComponent <CustomCommand>(); //Set Parent not done in instantiate in order to maintain relative position go.transform.SetParent(mainCanvas.transform, false); customCommand.data = data; return(customCommand); }
public void MergeFrom(CustomCommandData other) { if (other.CustomCommandAttempted.HasValue) { CustomCommandAttempted = other.CustomCommandAttempted; } if (other.CustomCommandSucceeded.HasValue) { CustomCommandSucceeded = other.CustomCommandSucceeded; } if (other.CustomCommandLatencyMs.HasValue) { CustomCommandLatencyMs = other.CustomCommandLatencyMs; } }
void LoadData() { try { ccData = CCData.ReadObject <CustomCommandData>(); if (ccData == null) { Puts("Created a new CustomCommands Data File"); ccData = new CustomCommandData(); } } catch { Puts("Couldn't load the CustomCommands Data, creating a new datafile"); ccData = new CustomCommandData(); } }
public static void AddCustomCommandData(CustomCommandData data) { customCommandContainer.customCommands.Add(data); }
public static void RemoveCommandData(CustomCommandData data) { customCommandContainer.customCommands.Remove(data); }
void RecordCustomCommandData(CustomCommandData data) { _action.UpdateEvent(new DeveloperLogEvent { CustomCommand = data }); }