コード例 #1
0
 void UnregisterEventListeners( )
 {
     if (null != local_35_UnityEngine_GameObject)
     {
         {
             uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
             if (null != component)
             {
                 component.OnCustomEvent -= Instance_OnCustomEvent_22;
             }
         }
         {
             uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
             if (null != component)
             {
                 component.OnCustomEvent -= Instance_OnCustomEvent_28;
             }
         }
     }
     if (null != owner_Connection_0)
     {
         {
             uScript_Triggers component = owner_Connection_0.GetComponent <uScript_Triggers>();
             if (null != component)
             {
                 component.OnEnterTrigger     -= Instance_OnEnterTrigger_1;
                 component.OnExitTrigger      -= Instance_OnExitTrigger_1;
                 component.WhileInsideTrigger -= Instance_WhileInsideTrigger_1;
             }
         }
     }
     if (null != owner_Connection_27)
     {
         {
             uScript_Global component = owner_Connection_27.GetComponent <uScript_Global>();
             if (null != component)
             {
                 component.uScriptStart     -= Instance_uScriptStart_31;
                 component.uScriptLateStart -= Instance_uScriptLateStart_31;
             }
         }
     }
 }
コード例 #2
0
ファイル: lift_doors.cs プロジェクト: Zyanede/Own-Projects
 void Instance_OnCustomEvent_28(object o, uScript_CustomEvent.CustomEventBoolArgs e)
 {
    //fill globals
    event_UnityEngine_GameObject_Sender_28 = e.Sender;
    event_UnityEngine_GameObject_EventName_28 = e.EventName;
    //relay event to nodes
    Relay_OnCustomEvent_28( );
 }
コード例 #3
0
    //property nodes

    //method nodes
   #pragma warning restore 414

    //functions to refresh properties from entities

    void SyncUnityHooks( )
    {
        SyncEventListeners( );
        //if our game object reference was changed then we need to reset event listeners
        if (local_34_UnityEngine_GameObject_previous != local_34_UnityEngine_GameObject || false == m_RegisteredForEvents)
        {
            //tear down old listeners

            local_34_UnityEngine_GameObject_previous = local_34_UnityEngine_GameObject;

            //setup new listeners
        }
        //if our game object reference was changed then we need to reset event listeners
        if (local_35_UnityEngine_GameObject_previous != local_35_UnityEngine_GameObject || false == m_RegisteredForEvents)
        {
            //tear down old listeners
            if (null != local_35_UnityEngine_GameObject_previous)
            {
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject_previous.GetComponent <uScript_CustomEvent>();
                    if (null != component)
                    {
                        component.OnCustomEvent -= Instance_OnCustomEvent_22;
                    }
                }
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject_previous.GetComponent <uScript_CustomEvent>();
                    if (null != component)
                    {
                        component.OnCustomEvent -= Instance_OnCustomEvent_28;
                    }
                }
            }

            local_35_UnityEngine_GameObject_previous = local_35_UnityEngine_GameObject;

            //setup new listeners
            if (null != local_35_UnityEngine_GameObject)
            {
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
                    if (null == component)
                    {
                        component = local_35_UnityEngine_GameObject.AddComponent <uScript_CustomEvent>();
                    }
                    if (null != component)
                    {
                        component.OnCustomEvent += Instance_OnCustomEvent_22;
                    }
                }
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
                    if (null == component)
                    {
                        component = local_35_UnityEngine_GameObject.AddComponent <uScript_CustomEvent>();
                    }
                    if (null != component)
                    {
                        component.OnCustomEvent += Instance_OnCustomEvent_28;
                    }
                }
            }
        }
        if (null == owner_Connection_0 || false == m_RegisteredForEvents)
        {
            owner_Connection_0 = parentGameObject;
            if (null != owner_Connection_0)
            {
                {
                    uScript_Triggers component = owner_Connection_0.GetComponent <uScript_Triggers>();
                    if (null == component)
                    {
                        component = owner_Connection_0.AddComponent <uScript_Triggers>();
                    }
                    if (null != component)
                    {
                        component.TimesToTrigger = event_UnityEngine_GameObject_TimesToTrigger_1;
                    }
                }
                {
                    uScript_Triggers component = owner_Connection_0.GetComponent <uScript_Triggers>();
                    if (null == component)
                    {
                        component = owner_Connection_0.AddComponent <uScript_Triggers>();
                    }
                    if (null != component)
                    {
                        component.OnEnterTrigger     += Instance_OnEnterTrigger_1;
                        component.OnExitTrigger      += Instance_OnExitTrigger_1;
                        component.WhileInsideTrigger += Instance_WhileInsideTrigger_1;
                    }
                }
            }
        }
        if (null == owner_Connection_27 || false == m_RegisteredForEvents)
        {
            owner_Connection_27 = parentGameObject;
            if (null != owner_Connection_27)
            {
                {
                    uScript_Global component = owner_Connection_27.GetComponent <uScript_Global>();
                    if (null == component)
                    {
                        component = owner_Connection_27.AddComponent <uScript_Global>();
                    }
                    if (null != component)
                    {
                        component.uScriptStart     += Instance_uScriptStart_31;
                        component.uScriptLateStart += Instance_uScriptLateStart_31;
                    }
                }
            }
        }
    }
コード例 #4
0
    void RegisterForUnityHooks( )
    {
        SyncEventListeners( );
        //if our game object reference was changed then we need to reset event listeners
        if (local_34_UnityEngine_GameObject_previous != local_34_UnityEngine_GameObject || false == m_RegisteredForEvents)
        {
            //tear down old listeners

            local_34_UnityEngine_GameObject_previous = local_34_UnityEngine_GameObject;

            //setup new listeners
        }
        //if our game object reference was changed then we need to reset event listeners
        if (local_35_UnityEngine_GameObject_previous != local_35_UnityEngine_GameObject || false == m_RegisteredForEvents)
        {
            //tear down old listeners
            if (null != local_35_UnityEngine_GameObject_previous)
            {
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject_previous.GetComponent <uScript_CustomEvent>();
                    if (null != component)
                    {
                        component.OnCustomEvent -= Instance_OnCustomEvent_22;
                    }
                }
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject_previous.GetComponent <uScript_CustomEvent>();
                    if (null != component)
                    {
                        component.OnCustomEvent -= Instance_OnCustomEvent_28;
                    }
                }
            }

            local_35_UnityEngine_GameObject_previous = local_35_UnityEngine_GameObject;

            //setup new listeners
            if (null != local_35_UnityEngine_GameObject)
            {
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
                    if (null == component)
                    {
                        component = local_35_UnityEngine_GameObject.AddComponent <uScript_CustomEvent>();
                    }
                    if (null != component)
                    {
                        component.OnCustomEvent += Instance_OnCustomEvent_22;
                    }
                }
                {
                    uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
                    if (null == component)
                    {
                        component = local_35_UnityEngine_GameObject.AddComponent <uScript_CustomEvent>();
                    }
                    if (null != component)
                    {
                        component.OnCustomEvent += Instance_OnCustomEvent_28;
                    }
                }
            }
        }
        //reset event listeners if needed
        //this isn't a variable node so it should only be called once per enabling of the script
        //if it's called twice there would be a double event registration (which is an error)
        if (false == m_RegisteredForEvents)
        {
            if (null != owner_Connection_0)
            {
                {
                    uScript_Triggers component = owner_Connection_0.GetComponent <uScript_Triggers>();
                    if (null == component)
                    {
                        component = owner_Connection_0.AddComponent <uScript_Triggers>();
                    }
                    if (null != component)
                    {
                        component.TimesToTrigger = event_UnityEngine_GameObject_TimesToTrigger_1;
                    }
                }
                {
                    uScript_Triggers component = owner_Connection_0.GetComponent <uScript_Triggers>();
                    if (null == component)
                    {
                        component = owner_Connection_0.AddComponent <uScript_Triggers>();
                    }
                    if (null != component)
                    {
                        component.OnEnterTrigger     += Instance_OnEnterTrigger_1;
                        component.OnExitTrigger      += Instance_OnExitTrigger_1;
                        component.WhileInsideTrigger += Instance_WhileInsideTrigger_1;
                    }
                }
            }
        }
        //reset event listeners if needed
        //this isn't a variable node so it should only be called once per enabling of the script
        //if it's called twice there would be a double event registration (which is an error)
        if (false == m_RegisteredForEvents)
        {
            if (null != owner_Connection_27)
            {
                {
                    uScript_Global component = owner_Connection_27.GetComponent <uScript_Global>();
                    if (null == component)
                    {
                        component = owner_Connection_27.AddComponent <uScript_Global>();
                    }
                    if (null != component)
                    {
                        component.uScriptStart     += Instance_uScriptStart_31;
                        component.uScriptLateStart += Instance_uScriptLateStart_31;
                    }
                }
            }
        }
    }
コード例 #5
0
    void Relay_In_33()
    {
        {
            {
                {
                    //if our game object reference was changed then we need to reset event listeners
                    if (local_34_UnityEngine_GameObject_previous != local_34_UnityEngine_GameObject || false == m_RegisteredForEvents)
                    {
                        //tear down old listeners

                        local_34_UnityEngine_GameObject_previous = local_34_UnityEngine_GameObject;

                        //setup new listeners
                    }
                }
                logic_uScriptAct_GetParent_Target_33 = local_34_UnityEngine_GameObject;
            }
            {
            }
        }
        logic_uScriptAct_GetParent_uScriptAct_GetParent_33.In(logic_uScriptAct_GetParent_Target_33, out logic_uScriptAct_GetParent_Parent_33);
        local_35_UnityEngine_GameObject = logic_uScriptAct_GetParent_Parent_33;
        {
            //if our game object reference was changed then we need to reset event listeners
            if (local_35_UnityEngine_GameObject_previous != local_35_UnityEngine_GameObject || false == m_RegisteredForEvents)
            {
                //tear down old listeners
                if (null != local_35_UnityEngine_GameObject_previous)
                {
                    {
                        uScript_CustomEvent component = local_35_UnityEngine_GameObject_previous.GetComponent <uScript_CustomEvent>();
                        if (null != component)
                        {
                            component.OnCustomEvent -= Instance_OnCustomEvent_22;
                        }
                    }
                    {
                        uScript_CustomEvent component = local_35_UnityEngine_GameObject_previous.GetComponent <uScript_CustomEvent>();
                        if (null != component)
                        {
                            component.OnCustomEvent -= Instance_OnCustomEvent_28;
                        }
                    }
                }

                local_35_UnityEngine_GameObject_previous = local_35_UnityEngine_GameObject;

                //setup new listeners
                if (null != local_35_UnityEngine_GameObject)
                {
                    {
                        uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
                        if (null == component)
                        {
                            component = local_35_UnityEngine_GameObject.AddComponent <uScript_CustomEvent>();
                        }
                        if (null != component)
                        {
                            component.OnCustomEvent += Instance_OnCustomEvent_22;
                        }
                    }
                    {
                        uScript_CustomEvent component = local_35_UnityEngine_GameObject.GetComponent <uScript_CustomEvent>();
                        if (null == component)
                        {
                            component = local_35_UnityEngine_GameObject.AddComponent <uScript_CustomEvent>();
                        }
                        if (null != component)
                        {
                            component.OnCustomEvent += Instance_OnCustomEvent_28;
                        }
                    }
                }
            }
        }

        //save off values because, if there are multiple, our relay logic could cause them to change before the next value is tested
    }