Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
            public void SetAttemptedCustomCommand(bool attempted)
            {
                var customCommand = new CustomCommandData {
                    CustomCommandAttempted = attempted
                };

                RecordCustomCommandData(customCommand);
            }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
        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();
     }
 }
Ejemplo n.º 6
0
 public static void AddCustomCommandData(CustomCommandData data)
 {
     customCommandContainer.customCommands.Add(data);
 }
Ejemplo n.º 7
0
 public static void RemoveCommandData(CustomCommandData data)
 {
     customCommandContainer.customCommands.Remove(data);
 }
Ejemplo n.º 8
0
 void RecordCustomCommandData(CustomCommandData data)
 {
     _action.UpdateEvent(new DeveloperLogEvent {
         CustomCommand = data
     });
 }