Esempio n. 1
0
        public override void OnDrawGizmos()
        {
            base.OnDrawGizmos();

            #if UNITY_EDITOR
            var label = Fullname + "\n";

            if (CurrentAction != null)
            {
                label += $"{CurrentAction.ToString()}\n";
            }

            var style = new GUIStyle();
            style.fontSize         = 10;
            style.normal.textColor = Color.white;

            // current actions
            var position = _thing.transform.position + Vector3.up + Vector3.right;
            UnityEditor.Handles.Label(position, label, style);
            #endif
        }
        } // RecordAction

        #endregion

        #region Check Not Running Before Recording

        private static void CheckNotRunningBeforeRecording(IAction candidate)
        {
            if (CurrentAction != null)
            {
                string candidateActionName = candidate != null ? candidate.ToString() : "";
                throw new InvalidOperationException
                (
                    string.Format
                    (
                          "ActionManager.RecordActionDirectly: the ActionManager is currently running "
                        + "or undoing an action ({0}), and this action (while being executed) attempted "
                        + "to recursively record another action ({1}), which is not allowed. "
                        + "You can examine the stack trace of this exception to see what the "
                        + "executing action did wrong and change this action not to influence the "
                        + "Undo stack during its execution. Checking if ActionManager.ActionIsExecuting == true "
                        + "before launching another transaction might help to avoid the problem. Thanks and sorry for the inconvenience.",
                        CurrentAction.ToString(),
                        candidateActionName
                    )
                );
            }
        } // CheckNotRunningBeforeRecording
    /// <summary>
    /// Returns URL for the inner IFrame.
    /// </summary>
    private string GetFrameUrl(object nodeIds, object parentAlias, object targetId, object ext, object aliasPath, object multiple, object action, object parameters)
    {
        string frameUrl = ResolveUrl("~/CMSModules/Content/Controls/Dialogs/Properties/DocCopyMoveProperites.aspx");

        Hashtable properties = new Hashtable();

        // Fill properties table
        properties.Add("sourcenodeids", nodeIds);
        properties.Add("parentalias", parentAlias);
        properties.Add("targetid", targetId);
        properties.Add("ext", ext);
        properties.Add("aliaspath", aliasPath);
        properties.Add("multiple", multiple);
        properties.Add("parameters", parameters);
        properties.Add("output", CurrentAction.ToString());

        Hashtable param = WindowHelper.GetItem(parameters as string) as Hashtable;

        if (param != null)
        {
            // Transfer parameters to new hashtable for iframe
            foreach (string key in param.Keys)
            {
                properties[key] = param[key];
            }
        }

        if ((action != null) && (ValidationHelper.GetInteger(targetId, 0) > 0))
        {
            properties.Add("action", action);
        }
        WindowHelper.Add(Identifier, properties);

        frameUrl = URLHelper.AddParameterToUrl(frameUrl, "params", Identifier);
        frameUrl = URLHelper.AddParameterToUrl(frameUrl, "hash", QueryHelper.GetHash(frameUrl));
        return(frameUrl);
    }
Esempio n. 4
0
 private void ShowDebugStuff()
 {
     m_BossActionText.text = CurrentAction.ToString();
     //m_BossDecidedActionText.text = DecidedAction.ToString();
     //m_PlayerDistanceText.text = GetDistanceToPlayer().ToString();
 }