Exemplo n.º 1
0
        protected void SyncLists(List <ActionParameter> externalParameters, List <ActionParameter> oldLocalParameters)
        {
            if (!hasUpgradedAgain)
            {
                // If parameters were deleted before upgrading, there may be a mismatch - so first ensure that order internal IDs match external

                if (oldLocalParameters != null && externalParameters != null && oldLocalParameters.Count != externalParameters.Count && oldLocalParameters.Count > 0)
                {
                    ACDebug.LogWarning("Parameter mismatch detected - please check the 'ActionList: Run' Action for its parameter values.");
                }

                for (int i = 0; i < externalParameters.Count; i++)
                {
                    if (i < oldLocalParameters.Count)
                    {
                        oldLocalParameters[i].ID = externalParameters[i].ID;
                    }
                }

                hasUpgradedAgain = true;
            }

            // Now that all parameter IDs match to begin with, we can rebuild the internal record based on the external parameters
            SetParametersBase.GUIData newGUIData = SetParametersBase.SyncLists(externalParameters, new SetParametersBase.GUIData(oldLocalParameters, parameterIDs));
            localParameters = newGUIData.fromParameters;
            parameterIDs    = newGUIData.parameterIDs;
        }
Exemplo n.º 2
0
 protected void SendParameters(List <ActionParameter> externalParameters, bool sendingToAsset)
 {
     if (runMode == RunMode.RunOnly)
     {
         return;
     }
     SyncLists(externalParameters, localParameters);
     SetParametersBase.BulkAssignParameterValues(externalParameters, localParameters, sendingToAsset, isAssetFile);
 }
Exemplo n.º 3
0
        private void SendParameters(List <ActionParameter> externalParameters, bool sendingToAsset)
        {
            if (!setParameters)
            {
                return;
            }

            SyncLists(externalParameters, localParameters);
            SetParametersBase.BulkAssignParameterValues(externalParameters, localParameters, sendingToAsset, isAssetFile);
        }
Exemplo n.º 4
0
        private void SetParametersGUI(List <ActionParameter> externalParameters, List <ActionParameter> ownParameters = null)
        {
            setParameters = EditorGUILayout.Toggle("Set parameters?", setParameters);
            if (!setParameters)
            {
                return;
            }

            SetParametersBase.GUIData guiData = SetParametersBase.SetParametersGUI(externalParameters, isAssetFile, new SetParametersBase.GUIData(localParameters, parameterIDs), ownParameters);
            localParameters = guiData.fromParameters;
            parameterIDs    = guiData.parameterIDs;
        }
Exemplo n.º 5
0
        private void SetParametersGUI(List <ActionParameter> externalParameters, List <ActionParameter> ownParameters = null)
        {
            runMode = (RunMode)EditorGUILayout.EnumPopup("Run mode:", runMode);
            if (runMode == RunMode.RunOnly)
            {
                return;
            }

            SetParametersBase.GUIData guiData = SetParametersBase.SetParametersGUI(externalParameters, isAssetFile, new SetParametersBase.GUIData(localParameters, parameterIDs), ownParameters);
            localParameters = guiData.fromParameters;
            parameterIDs    = guiData.parameterIDs;
        }