Пример #1
0
        //----------------------------------------------------------
        #region  Unity イベント関数
        //----------------------------------------------------------

        private void Awake()
        {
            mCamera      = GetComponent <Camera>();
            mListener    = GetComponent <AudioListener>();
            mAudioSource = GetComponent <AudioSource>();
            Assert.IsNotNull(mCamera);
            Assert.IsNotNull(mListener);
            Assert.IsNotNull(mAudioSource);
            Assert.IsNotNull(Resource);

            Resource.Initialize();

            mTime    = new Time();
            mGraphic = new Graphic(Resource, mCamera);
            mGraphic.SetResolution(CanvasWidth, CanvasHeight);
            mSound         = new Sound(Resource, mAudioSource);
            mCollision     = new Collision(Resource);
            mNetwork       = new Network(this, mGraphic);
            mPointer       = new Pointer(mGraphic);
            mKeyboard      = new Keyboard();
            mAccelerometer = new Accelerometer();
            mGeolocation   = new Geolocation();
            mCameraDevice  = new CameraDevice(mGraphic);
            mProxy         = new Proxy(mTime, mGraphic, mSound, mCollision, mNetwork, mPointer, mKeyboard, mAccelerometer, mGeolocation, mCameraDevice);
        }
Пример #2
0
        //----------------------------------------------------------
        #region パブリック関数
        //----------------------------------------------------------

        /// <summary>
        /// コンストラクタ
        /// </summary>
        internal Proxy(Time time, Graphic graphic, Sound sound, Collision collision, Network network
                       , Pointer pointer, Keyboard keyboard, Accelerometer accelerometer, Geolocation geolocation, CameraDevice cameraDevice)
        {
            cTime          = time;
            cGraphic       = graphic;
            cSound         = sound;
            cCollision     = collision;
            cNetwork       = network;
            cPointer       = pointer;
            cKeyboard      = keyboard;
            cAccelerometer = accelerometer;
            cGeolocation   = geolocation;
            cCameraDevice  = cameraDevice;
            mRandom        = new System.Random();
        }