Exemplo n.º 1
0
 /// <summary> Initialize the TouchDetector </summary>
 public static void Init()
 {
     if (s_instance != null)
     {
         return;
     }
     s_instance = Instance;
 }
 private void Awake()
 {
     TouchDetector.Init();
     if (OverrideTarget && (!OverrideTarget || TargetGameObject != null))
     {
         return;
     }
     TargetGameObject = gameObject;
     if (OnGestureAction == null)
     {
         OnGestureAction = delegate { }
     }
     ;
 }
Exemplo n.º 3
0
        private void Awake()
        {
            if (s_instance != null && s_instance != this)
            {
                DDebug.Log("There cannot be two '" + GetType().Name + "' active at the same time. Destroying this one!");
                Destroy(gameObject);
                return;
            }

            s_instance = this;
            DontDestroyOnLoad(gameObject);

            Initialize();

            if (EventSystem.current != null)
            {
                return;
            }
            new GameObject("EventSystem", typeof(EventSystem), typeof(StandaloneInputModule));
        }