Exemplo n.º 1
0
        private void LoadAsset(string guid)
        {
            string       assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(guid);
            BaseInputSet asset     = UnityEditor.AssetDatabase.LoadAssetAtPath <BaseInputSet>(assetPath);

            if (asset != null)
            {
                OnInputSetCreated(asset);
            }
        }
Exemplo n.º 2
0
 private void OnInputSetCreated(BaseInputSet newInputSet)
 {
     if (ExistsInInputSetStates(newInputSet) == false)
     {
         InputSetState newState = new InputSetState
         {
             inputSet = newInputSet
         };
         inputSetStates.Add(newState);
     }
 }
Exemplo n.º 3
0
 private bool ExistsInInputSetStates(BaseInputSet inputSet)
 {
     for (int i = 0; i < inputSetStates.Count; i++)
     {
         if (inputSet.GetType() == inputSetStates[i].inputSet.GetType())
         {
             Debug.LogWarning("Attempted to add an already existing InputSet to the InputContext. This is not allowed!");
             return(true);
         }
     }
     return(false);
 }