This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class PlayerControl : MonoBehaviour | |
| { | |
| [HideInInspector] | |
| public bool facingRight = true; // For determining which way the player is currently facing. | |
| [HideInInspector] | |
| public bool jump = false; // Condition for whether the player should jump. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| // Objects to drag in | |
| public var motor : MovementMotor; | |
| public var character : Transform; | |
| public var cursorPrefab : GameObject; | |
| public var joystickPrefab : GameObject; | |
| // Settings | |
| public var cameraSmoothing : float = 0.01; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <UIKit/UIKit.h> | |
| @interface AppDelegate : UIResponder <UIApplicationDelegate> | |
| @property (nonatomic, strong) UIWindow *window; | |
| @property (nonatomic, strong) UIViewController *rootViewController; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation | |
| moduleName:@"MCDJ" | |
| initialProperties:nil | |
| launchOptions:launchOptions]; | |
| self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
| UIViewController *rootViewController = [[UIViewController alloc] init]; | |
| rootViewController.view = rootView; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| #import "RCTBridge.h" | |
| #import "RCTEventDispatcher.h" | |
| #import <MediaPlayer/MediaPlayer.h> | |
| @import AVFoundation; | |
| @interface MediaController : NSObject<RCTBridgeModule,MPMediaPickerControllerDelegate, AVAudioPlayerDelegate> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void)showMediaPicker { | |
| if(self.mediaPicker == nil) { | |
| self.mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeAnyAudio]; | |
| [self.mediaPicker setDelegate:self]; | |
| [self.mediaPicker setAllowsPickingMultipleItems:NO]; | |
| [self.mediaPicker setShowsCloudItems:NO]; | |
| self.mediaPicker.prompt = @"Select song"; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void) mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection { | |
| MPMediaItem *mediaItem = mediaItemCollection.items[0]; | |
| NSURL *assetURL = [mediaItem valueForProperty:MPMediaItemPropertyAssetURL]; | |
| [self.bridge.eventDispatcher sendAppEventWithName:@"SongPlaying" body:[mediaItem valueForProperty:MPMediaItemPropertyTitle]]; | |
| //... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var React = require('react-native'); | |
| var MediaController = require('NativeModules').MediaController; | |
| var { | |
| AppRegistry, | |
| StyleSheet, | |
| Text, | |
| TouchableHighlight, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import "MediaController.h" | |
| #import "AppDelegate.h" | |
| @implementation MediaController | |
| RCT_EXPORT_MODULE(); | |
| @synthesize bridge = _bridge; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { | |
| View, | |
| Text, | |
| TouchableOpacity | |
| } from 'react-native'; | |
| class MyComponent extends Component { | |
| componentWillMount() { |