Пример #1
0
    void Start()
    {
        text = GetComponent <Text>();

        if (eventSystem == null)
        {
            GameObject obj = GameObject.Find(ABFEvents.DEFAULT_EVENT_SYSTEM_NAME);
            if (obj != null)
            {
                var evts = obj.GetComponent <ABFEvents>();
                if (evts != null)
                {
                    this.eventSystem = evts;
                }
                else
                {
                    Debug.LogError($"{name} has no event system");
                }
            }
            else
            {
                Debug.LogError($"{name} has no event system");
            }
        }

        eventSystem.GroundEvent += OnGroundChange;
    }
Пример #2
0
 void Start()
 {
     pm_collider           = GetComponent <Collider>();
     pm_collider.isTrigger = true;
     if (eventSystem == null)
     {
         GameObject obj = GameObject.Find(ABFEvents.DEFAULT_EVENT_SYSTEM_NAME);
         if (obj != null)
         {
             var evts = obj.GetComponent <ABFEvents>();
             if (evts != null)
             {
                 this.eventSystem = evts;
             }
             else
             {
                 Debug.LogError($"{name} has no event system");
             }
         }
         else
         {
             Debug.LogError($"{name} has no event system");
         }
     }
 }