void Awake()
 {
     animator = GetComponent<Animator>();
     characterController2D = GetComponent<CharacterController2D>();
     characterController2D.onControllerCollidedEvent += onControllerCollider;
     input = GetComponent<AbstractInput> ();
 }
예제 #2
0
파일: GameData.cs 프로젝트: atom-chen/AKG
    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;
    }
예제 #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;
 }
예제 #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;
 }
예제 #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);
    }
예제 #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;
//        }
    }
예제 #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);
    }
예제 #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;
        }
예제 #9
0
 public TouchSensor(AbstractInput input, GameObjectFinder gameObjectFinder)
 {
     this.input            = input;
     this.gameObjectFinder = gameObjectFinder;
 }
예제 #10
0
 public TouchSensor(AbstractInput input, GameObjectFinder gameObjectFinder)
 {
     this.input = input;
     this.gameObjectFinder = gameObjectFinder;
 }
예제 #11
0
 void Start()
 {
     PresentData.Instance.LevelInit.OnLoadComplete += OnLoadComplete;
     inputManager = GameData.Instance.InputManager;
 }
예제 #12
0
파일: Ball.cs 프로젝트: eonyanov/testgame
 // 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;
 }
예제 #14
0
 public Dragger(AbstractInput input, Sprite sprite)
 {
     this.input         = input;
     this.sprite        = sprite;
     this.startPosition = sprite.getScreenPosition();
 }
예제 #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);
    }
예제 #16
0
 public Dragger(AbstractInput input, Sprite sprite)
 {
     this.input = input;
     this.sprite = sprite;
     this.startPosition = sprite.getScreenPosition();
 }