Ejemplo n.º 1
0
    void DoActionRPC(string actionKey, int actionNumber)
    {
        ActiveObject activeObject = FindActiveObject(actionNumber);

        if (activeObject != null)
        {
            activeObject.PerformAction();
        }
    }
Ejemplo n.º 2
0
    public virtual bool DoAction(string actionKey, ActiveObject activeObject)
    {
        if (possibleActions.ContainsKey(actionKey))
        {
            if (IsActionReady(actionKey))
            {
                activeObject.PerformAction();
                possibleActions[actionKey].Invoke();
                StartCoroutine("ActionCooldown", actionKey);

                return(true);
            }
        }

        return(false);
    }