void Awake()
 {
     animator = GetComponent<Animator>();
     characterController2D = GetComponent<CharacterController2D>();
     characterController2D.onControllerCollidedEvent += onControllerCollider;
     input = GetComponent<AbstractInput> ();
 }
Example #2
0
    void Awake()
    {
        var inputRoot            = transform.Find("InputRoot");
        var hudInputManager      = inputRoot.transform.Find("HUD").GetComponent <HUDInput>();
        var keyboardInputManager = inputRoot.transform.Find("Keyboard").GetComponent <VirtualInput>();

        InputManager = (inputDevice == InputDevice.HUD) ? hudInputManager as AbstractInput : keyboardInputManager as AbstractInput;
    }
Example #3
0
 public AbstractScene(SceneManager manager, GameObjectFactory <string> resourceFactory, GameObjectFinder finder, AbstractInput input)
 {
     sceneManager          = manager;
     this.resourceFactory  = resourceFactory;
     this.gameObjectFinder = finder;
     this.input            = input;
     completed             = false;
     permitUnloadResources = true;
     camera = Camera.main;
 }
Example #4
0
 public AbstractScene(SceneManager manager, GameObjectFactory<string> resourceFactory, GameObjectFinder finder, AbstractInput input)
 {
     sceneManager = manager;
     this.resourceFactory = resourceFactory;
     this.gameObjectFinder = finder;
     this.input = input;
     completed = false;
     permitUnloadResources = true;
     camera = Camera.main;
 }
Example #5
0
    public SpeechBubble(Camera camera, float leftToRightSwitchOverPosition)
    {
        this.camera = camera;
        this.leftToRightSwitchOverPosition = leftToRightSwitchOverPosition;
        speechBubble      = Sprite.create("SceneFour/bubble");
        speechBubbleLeft  = Sprite.create("SceneFour/bubble_1");
        speechBubbleRight = Sprite.create("SceneFour/bubble_2");
        speechBubbleRight.visible(false);

        speechBubble.setWorldPosition(-80f, 60f, -1f);
        speechBubbleLeft.setWorldPosition(-55f, 50f, -5f);
        speechBubbleRight.setWorldPosition(-55f, 50f, -5f);
        speechBubbleRight.transform.Rotate(Vector3.forward * 5);

        input   = new UnityInput();
        dragger = new Dragger(input, speechBubble);
    }
Example #6
0
    void Awake()
    {
        currentInput = touchInput;

//        if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsEditor)
//        {
//            currentInput = touchInput;
//        }
//        else if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
//        {
//            currentInput = touchInput;
//        }
//        else
//        {
//            currentInput = hardwareInput;
//        }
    }
Example #7
0
    public SpeechBubble(Camera camera, float leftToRightSwitchOverPosition)
    {
        this.camera = camera;
        this.leftToRightSwitchOverPosition = leftToRightSwitchOverPosition;
        speechBubble = Sprite.create("SceneFour/bubble");
        speechBubbleLeft = Sprite.create("SceneFour/bubble_1");
        speechBubbleRight = Sprite.create("SceneFour/bubble_2");
        speechBubbleRight.visible(false);

        speechBubble.setWorldPosition(-80f, 60f, -1f);
        speechBubbleLeft.setWorldPosition(-55f, 50f, -5f);
        speechBubbleRight.setWorldPosition(-55f, 50f, -5f);
        speechBubbleRight.transform.Rotate(Vector3.forward * 5);

        input = new UnityInput();
        dragger = new Dragger(input, speechBubble);
    }
Example #8
0
        public static void Init()
        {
            if (InputSystem.TKeyboard != null || TryLoadModule("Unity.InputSystem", InputSystem.TKeyboard))
            {
                inputModule = new InputSystem();
            }
            else if (LegacyInput.TInput != null || TryLoadModule("UnityEngine.InputLegacyModule", LegacyInput.TInput))
            {
                inputModule = new LegacyInput();
            }

            if (inputModule == null)
            {
                ExplorerCore.LogWarning("Could not find any Input module!");
                inputModule = new NoInput();
            }

            inputModule.Init();

            bool TryLoadModule(string dll, Type check) => ReflectionHelpers.LoadModule(dll) && check != null;
        }
Example #9
0
 public TouchSensor(AbstractInput input, GameObjectFinder gameObjectFinder)
 {
     this.input            = input;
     this.gameObjectFinder = gameObjectFinder;
 }
Example #10
0
 public TouchSensor(AbstractInput input, GameObjectFinder gameObjectFinder)
 {
     this.input = input;
     this.gameObjectFinder = gameObjectFinder;
 }
Example #11
0
 void Start()
 {
     PresentData.Instance.LevelInit.OnLoadComplete += OnLoadComplete;
     inputManager = GameData.Instance.InputManager;
 }
Example #12
0
 // Start is called before the first frame update
 private void Start()
 {
     _rigidbody = GetComponent <Rigidbody>();
     _input     = MainController.Instance.GetInput;
 }
 public void SetControllingAbstractInput(AbstractInput controllingInput)
 {
     abstractInput = controllingInput;
 }
Example #14
0
 public Dragger(AbstractInput input, Sprite sprite)
 {
     this.input         = input;
     this.sprite        = sprite;
     this.startPosition = sprite.getScreenPosition();
 }
Example #15
0
    // Use this for initialization
    void Start()
    {
        input = new XboxInput ((XboxController)playerIndex);
        ballMaterial = GetComponent<Renderer> ().material;
        initialColor = ballMaterial.color;

        arrow.SetActive (false);
        //
        stateMachine = new StateMachine (this);
        stateMachine.SetState (new IdleState ());

        //		direction = new Vector3 (0, 0, 0);
        //		rb = GetComponent<Rigidbody> ();
        startPos = transform.position;

        //		shootLock = new TimeDurationLock (1);
    }
Example #16
0
 public Dragger(AbstractInput input, Sprite sprite)
 {
     this.input = input;
     this.sprite = sprite;
     this.startPosition = sprite.getScreenPosition();
 }