Beispiel #1
0
        private void UseAction()
        {
            // Calling clientside code. If this is a spell,
            // then the spell will call the server to run on the server itself.
            // Not sure why we don't call the spell serverside from here, too...
            // The spell's server request can provide a click position.
            if (iActionGUI.ActionData.CallOnClient)
            {
                iActionGUI.CallActionClient();
            }

            // Sending a message to server asking to run serverside code.
            // TODO: Doesn't support click positions yet.
            // Once it does, consider moving the spell's server request to rely on this here instead, if possible.
            if (iActionGUI.ActionData.CallOnServer == false)
            {
                return;
            }
            if (iActionGUI is IServerActionGUI)
            {
                if (iActionGUI is UIActionScriptableObject actionSO)
                {
                    RequestGameActionSO.Send(actionSO);
                }
                else
                {
                    RequestGameAction.Send(iActionGUI as IServerActionGUI);
                }
            }
        }
Beispiel #2
0
    public void ButtonPress()
    {
        SoundManager.Play("Click01");
        //calling clientside code
        if (iActionGUI.ActionData.CallOnClient)
        {
            iActionGUI.CallActionClient();
        }

        //sending a message to server asking to run serverside code
        if (iActionGUI.ActionData.CallOnServer)
        {
            if (iActionGUI is IServerActionGUI)
            {
                if (iActionGUI is UIActionScriptableObject actionSO)
                {
                    RequestGameActionSO.Send(actionSO);
                }
                else
                {
                    RequestGameAction.Send(iActionGUI as IServerActionGUI);
                }
            }
        }
    }
Beispiel #3
0
    public static void Send(UIActionScriptableObject uIActionScriptableObject)
    {
        RequestGameActionSO msg = new RequestGameActionSO
        {
            soID = UIActionSOSingleton.ActionsTOID[uIActionScriptableObject]
        };

        msg.Send();
    }
Beispiel #4
0
    public void ButtonPress()
    {
        SoundManager.Play("Click01");
        if (iActionGUI.ActionData.CallOnClient)
        {
            iActionGUI.CallActionClient();
        }

        if (iActionGUI.ActionData.CallOnServer)
        {
            if (iActionGUI is IServerActionGUI)
            {
                if (iActionGUI is UIActionScriptableObject)
                {
                    var iIActionScriptableObject = iActionGUI as UIActionScriptableObject;
                    RequestGameActionSO.Send(iIActionScriptableObject);
                }
                else
                {
                    RequestGameAction.Send(iActionGUI as IServerActionGUI);
                }
            }
        }
    }