Пример #1
0
 protected void InitButton()
 {
     inputDetector          = GetComponent <InputDetector>();
     inputDetector.OnTouch += OnButtonPress;
     inputDetector.OnTouchReleaseAnywhere += OnButtonRelease;
     inputDetector.OnTouchAndRelease      += OnButtonPressAndRelease;
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     inputDetector                    = GetComponent <InputDetector>();
     inputDetector.OnTouch           += OnTouch;
     inputDetector.OnTouchRelease    += OnRelease;
     inputDetector.OnTouchAndRelease += OnTouchAndRelease;
 }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     if (singletonScripts != null)
     {
         inputDetector = (InputDetector)singletonScripts.GetComponent("InputDetector");
         webLoader     = singletonScripts.GetComponent <WebLoader>();
     }
 }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        inputDetector = GetComponent <InputDetector>();
        inputDetector.OnTouchReleaseAnywhere += OnTouchReleaseAnywhere;
        inputDetector.OnTouch += OnTouch;

        initialSize = this.transform.localScale;
    }
Пример #5
0
 public override void AddAchievementOnStart()
 {
     if (achievementUnlocked == false)
     {
         inputDetector = new GameObject().AddComponent <InputDetector>();
         inputDetector.OnInputDetected += CheckAchievement;
     }
 }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     if (scriptObject != null) {
         inputDetector = (InputDetector)scriptObject.GetComponent ("InputDetector");
         ringMenu = (RingMenu)scriptObject.GetComponent ("RingMenu");
     }
     if (userObject != null) {
         startingPosition = userObject.transform.position;
     }
 }
Пример #7
0
 public static void NotifyDetectorOnIdle(InputDetector detector)
 {
     if (registeredDetectors.Contains(detector))
     {
         detectorRecords[detector] -= 1;
         if (detectorRecords[detector] == 0)
         {
             RemoveDetector(detector);
         }
     }
 }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     if (scriptObject != null)
     {
         inputDetector = (InputDetector)scriptObject.GetComponent("InputDetector");
         ringMenu      = (RingMenu)scriptObject.GetComponent("RingMenu");
     }
     if (userObject != null)
     {
         startingPosition = userObject.transform.position;
     }
 }
Пример #9
0
 public static void NotifyDetectorOnBusy(InputDetector detector)
 {
     if (!registeredDetectors.Contains(detector))
     {
         detectorRecords[detector] = 1;
         RegisterDetector(detector);
     }
     else
     {
         detectorRecords[detector] += 1;
     }
 }
Пример #10
0
 public void Remap(string name, InputDetector detector)
 {
     if (_inputMap.ContainsKey(name))
     {
         InputManager.NotifyDetectorOnIdle(_inputMap[name]);
     }
     if (detector != null)
     {
         InputManager.NotifyDetectorOnBusy(detector);
         _inputMap[name] = detector;
     }
     else
     {
         _inputMap.Remove(name);
     }
 }
Пример #11
0
 // Use this for initialization
 void Start()
 {
     inputDetect = GetComponent <InputDetector>();
     controller  = GetComponent <PlayerController>();
 }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     if (singletonScripts != null) {
         inputDetector = (InputDetector) singletonScripts.GetComponent("InputDetector");
         webLoader = singletonScripts.GetComponent<WebLoader>();
     }
 }
Пример #13
0
 protected virtual void Awake()
 {
     inputDetector          = GetComponent <InputDetector>();
     inputDetector.OnTouch += OnItemTouch;
     inputDetector.OnTouchReleaseAnywhere += OnTouchRelease;
 }
Пример #14
0
 private static void RemoveDetector(InputDetector inputDetector)
 {
     inputDetector.Reset();
     registeredDetectors.Remove(inputDetector);
 }
Пример #15
0
 private static void RegisterDetector(InputDetector inputDetector) => registeredDetectors.Add(inputDetector);