コード例 #1
0
        public ActionTreeItem(SerializedProperty actionMapProperty, SerializedProperty setProperty, int index)
            : base(setProperty, index)
        {
            m_ActionMapProperty = actionMapProperty;
            actionName          = elementProperty.FindPropertyRelative("m_Name").stringValue;
            bindingsStartIndex  = InputActionSerializationHelpers.GetBindingsStartIndex(m_ActionMapProperty.FindPropertyRelative("m_Bindings"), actionName);
            bindingsCount       = InputActionSerializationHelpers.GetBindingCount(m_ActionMapProperty.FindPropertyRelative("m_Bindings"), actionName);
            displayName         = actionName;
            var actionMapName = m_ActionMapProperty.FindPropertyRelative("m_Name").stringValue;

            id = (actionMapName + "/" + displayName).GetHashCode();
        }
コード例 #2
0
 public ActionTreeItem(SerializedProperty actionMapProperty, SerializedProperty actionProperty, int index)
     : base(actionProperty, index)
 {
     m_ActionMapProperty = actionMapProperty;
     actionName          = elementProperty.FindPropertyRelative("m_Name").stringValue;
     if (m_ActionMapProperty != null)
     {
         bindingsStartIndex = InputActionSerializationHelpers.GetBindingsStartIndex(m_ActionMapProperty.FindPropertyRelative("m_Bindings"), actionName);
         bindingsCount      = InputActionSerializationHelpers.GetBindingCount(m_ActionMapProperty.FindPropertyRelative("m_Bindings"), actionName);
     }
     else
     {
         bindingsStartIndex = 0;
         bindingsCount      = InputActionSerializationHelpers.GetBindingCount(elementProperty.FindPropertyRelative("m_SingletonActionBindings"), actionName);
     }
     displayName = actionName;
     id          = GetIdForName(displayName);
 }