Esempio n. 1
0
    // calls (must be first)
    bool ActionUpdateCalls(FFActionSet set)
    {
        bool finishedSet = true;

        // store count so that added calls aren't called
        int voidcallcount;

        if (set.as_VoidCalls != null)
        {
            voidcallcount = set.as_VoidCalls.Count;
        }
        else
        {
            voidcallcount = 0;
        }

        // store count so that added calls aren't called
        int objectcallcount;

        if (set.as_ObjectCalls != null)
        {
            objectcallcount = set.as_ObjectCalls.Count;
        }
        else
        {
            objectcallcount = 0;
        }

        // void calls
        for (int j = 0; j < voidcallcount && set.as_VoidCalls != null; ++j)
        {
            set.as_VoidCalls.Dequeue()(); // call dequed function
        }

        // if any calls were added durring these calls, the set is not complete
        if (set.as_VoidCalls != null && set.as_VoidCalls.Count > 0)
        {
            finishedSet = false;
        }


        // object calls
        for (int j = 0; j < objectcallcount && set.as_ObjectCalls != null; ++j)
        {
            var caller = set.as_ObjectCalls.Dequeue(); // deque caller
            caller.call(caller.obj);
        }

        // if any calls were added durring these calls, the set is not complete
        if (set.as_ObjectCalls != null && set.as_ObjectCalls.Count > 0)
        {
            finishedSet = false;
        }

        return(finishedSet);
    }
Esempio n. 2
0
    // Get Fresh values at the start of a new FFActionSet
    void InitFFActionSet(FFActionSet set)
    {
        // InitFFActionSet
        #region int
        if (set.as_intProperties != null)
        {
            for (int i = 0; i < set.as_intProperties.Count; ++i)
            {
                set.as_intProperties[i].start_value = set.as_intProperties[i].var.Val;
            }
        }
        #endregion Int

        #region float
        if (set.as_floatProperties != null)
        {
            for (int i = 0; i < set.as_floatProperties.Count; ++i)
            {
                set.as_floatProperties[i].start_value = set.as_floatProperties[i].var.Val;
            }
        }
        #endregion float

        #region Vector2
        if (set.as_Vector2Properties != null)
        {
            for (int i = 0; i < set.as_Vector2Properties.Count; ++i)
            {
                set.as_Vector2Properties[i].start_value = set.as_Vector2Properties[i].var.Val;
            }
        }
        #endregion Vector2

        #region Vector3
        if (set.as_Vector3Properties != null)
        {
            for (int i = 0; i < set.as_Vector3Properties.Count; ++i)
            {
                set.as_Vector3Properties[i].start_value = set.as_Vector3Properties[i].var.Val;
            }
        }
        #endregion Vector3

        #region Vector4
        if (set.as_Vector4Properties != null)
        {
            for (int i = 0; i < set.as_Vector4Properties.Count; ++i)
            {
                set.as_Vector4Properties[i].start_value = set.as_Vector4Properties[i].var.Val;
            }
        }
        #endregion Vector4

        #region Color
        if (set.as_ColorProperties != null)
        {
            for (int i = 0; i < set.as_ColorProperties.Count; ++i)
            {
                set.as_ColorProperties[i].start_value = set.as_ColorProperties[i].var.Val;
            }
        }
        #endregion Color
    }