コード例 #1
0
ファイル: CameraController.cs プロジェクト: Zhaeong/blinq
    // Use this for initialization
    void Start()
    {
        //BeginningAnim = true;
        toGoal = true;
        lerpingValue = 1.3f;
        speed = 4.0f;
        chaseRange = 10.0f;
        if(lastScene)
            LSC = EndObj.GetComponent<LampStagController>();
        else
            LC = EndObj.GetComponent<LampController>();


        float StartCameraX = (PlayerChar.transform.position.x + cameraXval);
        float StartCameraY = (PlayerChar.transform.position.y + cameraYval);
        float StartCameraZ = (PlayerChar.transform.position.z + cameraZval);

        StartCameraPosit = new Vector3(StartCameraX, StartCameraY, StartCameraZ);
        StartCameraLook = new Vector3(StartCameraX - cameraXval, StartCameraY - cameraYval, StartCameraZ - cameraZval);

        float EndCameraX = (EndObj.transform.position.x + cameraXval);
        float EndCameraY = (EndObj.transform.position.y + cameraYval);
        float EndCameraZ = (EndObj.transform.position.z + cameraZval);

        EndCameraPosit = new Vector3(EndCameraX, EndCameraY, EndCameraZ);
        transform.position = StartCameraPosit;
        transform.LookAt(StartCameraLook);

    }
コード例 #2
0
        public MainFormController(ICCTrayMultiConfiguration configuration, ISynchronizeInvoke owner, MainForm mainForm)
        {
            this.mainForm      = mainForm;
            this.configuration = configuration;

            serverMonitors = configuration.GetServerMonitors();
            for (int i = 0; i < serverMonitors.Length; i++)
            {
                serverMonitors[i] = new SynchronizedServerMonitor(serverMonitors[i], owner);
            }
            aggregatedServerMonitor = new AggregatingServerMonitor(serverMonitors);
            queueIconProvider       = new ResourceIntegrationQueueIconProvider();

            projectMonitors = configuration.GetProjectStatusMonitors(serverMonitors);
            for (int i = 0; i < projectMonitors.Length; i++)
            {
                projectMonitors[i] = new SynchronizedProjectMonitor(projectMonitors[i], owner);
            }
            aggregatedProjectMonitor = new AggregatingProjectMonitor(projectMonitors);
            projectStateIconProvider = new ConfigurableProjectStateIconProvider(configuration.Icons);
            projectStateIconAdaptor  = new ProjectStateIconAdaptor(aggregatedProjectMonitor, projectStateIconProvider);
            soundPlayer = new BuildTransitionSoundPlayer(aggregatedProjectMonitor, new AudioPlayer(), configuration.Audio);
            execRunner  = new BuildTransitionExecRunner(aggregatedProjectMonitor, configuration.Execs);
            LampController lampController = new LampController(configuration.X10, null);

            x10Controller = new X10Controller(aggregatedProjectMonitor, new DateTimeProvider(), configuration.X10, lampController);

            growlController = new GrowlController(aggregatedProjectMonitor, configuration.Growl);

#if !DISABLE_COM
            IBalloonMessageProvider balloonMessageProvider = new ConfigurableBalloonMessageProvider(configuration.BalloonMessages);
            speakerForTheDead = new SpeakingProjectMonitor(aggregatedProjectMonitor, balloonMessageProvider, configuration.Speech);
#endif
        }
コード例 #3
0
 public void Hit(string side, LampController lamp)
 {
     if (!toggle)
     {
         if (side == "left")
         {
             lamp.NextLight();
             LeftSide();
             toggle = true;
             particleRight.Play();
             popUp.deletePopUp();
         }
     }
     else
     {
         if (side == "right")
         {
             lamp.NextLight();
             RightSide();
             toggle = false;
             particleLeft.Play();
             popUp.deletePopUp();
         }
     }
 }
コード例 #4
0
        public void SetUp()
        {
            x10LowLevelDriverMock = new Mock <IX10LowLevelDriver>(MockBehavior.Strict);

            X10Configuration configuration = new X10Configuration();

            configuration.SuccessUnitCode  = GREEN_LAMP_DEVICE_CODE;
            configuration.BuildingUnitCode = YELLOW_LAMP_DEVICE_CODE;
            configuration.FailureUnitCode  = RED_LAMP_DEVICE_CODE;
            IX10LowLevelDriver x10LowLevelDriver = x10LowLevelDriverMock.Object as IX10LowLevelDriver;

            lampController = new LampController(configuration, x10LowLevelDriver);
        }
コード例 #5
0
        public void SetUp()
        {
            x10LowLevelDriverMock        = new DynamicMock(typeof(IX10LowLevelDriver));
            x10LowLevelDriverMock.Strict = true;

            X10Configuration configuration = new X10Configuration();

            configuration.SuccessUnitCode  = GREEN_LAMP_DEVICE_CODE;
            configuration.BuildingUnitCode = YELLOW_LAMP_DEVICE_CODE;
            configuration.FailureUnitCode  = RED_LAMP_DEVICE_CODE;
            IX10LowLevelDriver x10LowLevelDriver = x10LowLevelDriverMock.MockInstance as IX10LowLevelDriver;

            lampController = new LampController(configuration, x10LowLevelDriver);
        }
コード例 #6
0
 public StarterGame(ILogger logger)
     : base(MachineType.WPC, logger)
 {
     this.lampctrl = new LampController(this);
 }
コード例 #7
0
ファイル: Program.cs プロジェクト: matijsbrs/BCom
        public Program()
        {
            BCom   bcom   = new BCom();
            Marvin marvin = new Marvin();

            NodeBySubscriptionString = new Dictionary <string, BCMsg>();
            NodeBySubscriptionHash   = new Dictionary <ushort, BCMsg>();
            DevicePathTable          = new Dictionary <uint, string>();

            Connect(Properties.Settings.Default.ComPort, 115200);
            ConnectToBroker();

            LampController lc1    = new LampController(client, 0x01945431, "huis/tuin/Lc");
            LampController lc2    = new LampController(client, 0x01945230, "work/desk/1/Lc");
            LampController lc3    = new LampController(client, 0x0F947A10, "work/desk/2/Lc");
            LampController lcWork = new LampController(client, 0x00000000, "group/Lc");

            LampController toren1  = new LampController(client, 0x0194540D, "toren/1");
            LampController toren2  = new LampController(client, 0x0F942418, "toren/2");
            LampController toren3  = new LampController(client, 0x01945B2A, "toren/3");
            LampController toren4  = new LampController(client, 0x0F942423, "toren/4");
            LampController toren5  = new LampController(client, 0x0F943E29, "toren/5");
            LampController toren6  = new LampController(client, 0x0F942E39, "toren/6");
            LampController toren7  = new LampController(client, 0x13D42C64, "toren/7");
            LampController toren8  = new LampController(client, 0x01945418, "toren/8");
            LampController toren9  = new LampController(client, 0x01945429, "toren/9");
            LampController toren10 = new LampController(client, 0x01945B1C, "toren/10");
            LampController toren11 = new LampController(client, 0x0F942F2F, "toren/11");
            LampController toren12 = new LampController(client, 0x0F942420, "toren/12");
            LampController toren13 = new LampController(client, 0x0F945A30, "toren/13");
            LampController toren14 = new LampController(client, 0x0F94241C, "toren/14");

            LampController toren = new LampController(client, 0x00000000, "toren/");

            toren1.relay.LinkedPeripherals.Add(toren.relay);
            toren2.relay.LinkedPeripherals.Add(toren.relay);
            toren3.relay.LinkedPeripherals.Add(toren.relay);
            toren4.relay.LinkedPeripherals.Add(toren.relay);
            toren5.relay.LinkedPeripherals.Add(toren.relay);
            toren6.relay.LinkedPeripherals.Add(toren.relay);
            toren7.relay.LinkedPeripherals.Add(toren.relay);
            toren8.relay.LinkedPeripherals.Add(toren.relay);
            toren9.relay.LinkedPeripherals.Add(toren.relay);
            toren10.relay.LinkedPeripherals.Add(toren.relay);
            toren11.relay.LinkedPeripherals.Add(toren.relay);
            toren12.relay.LinkedPeripherals.Add(toren.relay);
            toren13.relay.LinkedPeripherals.Add(toren.relay);
            toren14.relay.LinkedPeripherals.Add(toren.relay);

            marvin.Add(toren1);
            marvin.Add(toren2);
            marvin.Add(toren3);
            marvin.Add(toren4);
            marvin.Add(toren5);
            marvin.Add(toren6);
            marvin.Add(toren7);
            marvin.Add(toren8);
            marvin.Add(toren9);
            marvin.Add(toren10);
            marvin.Add(toren11);
            marvin.Add(toren12);
            marvin.Add(toren13);
            marvin.Add(toren14);
            marvin.Add(toren);

            marvin.Add(lc1);
            marvin.Add(lc2);
            marvin.Add(lc3);
            marvin.Add(lcWork);



            AddDeviceToHashTable(toren1);
            AddDeviceToHashTable(toren2);
            AddDeviceToHashTable(toren3);
            AddDeviceToHashTable(toren4);
            AddDeviceToHashTable(toren5);
            AddDeviceToHashTable(toren6);
            AddDeviceToHashTable(toren7);
            AddDeviceToHashTable(toren8);
            AddDeviceToHashTable(toren9);
            AddDeviceToHashTable(toren10);
            AddDeviceToHashTable(toren11);
            AddDeviceToHashTable(toren12);
            AddDeviceToHashTable(toren13);
            AddDeviceToHashTable(toren14);
            AddDeviceToHashTable(toren);

            lc1.AddSubscription(lcWork);

            DeviceManager deviceManager = new DeviceManager(client, 0x00001234, "system/network");

            marvin.Add(deviceManager);

            AddDeviceToHashTable(lc1);
            AddDeviceToHashTable(lc2);
            AddDeviceToHashTable(lc3);
            AddDeviceToHashTable(lcWork);

            AddDeviceToHashTable(deviceManager);

            deviceManager.addHashTables(NodeBySubscriptionString, NodeBySubscriptionHash, DevicePathTable);

            lc1.relay.Reset();
            lc3.relay.LinkedPeripherals.Add(lc1.relay);
            lc2.relay.LinkedPeripherals.Add(lc1.relay);

            lc1.relay.LinkedPeripherals.Add(lcWork.relay);
            lc2.relay.LinkedPeripherals.Add(lcWork.relay);
            lc3.relay.LinkedPeripherals.Add(lcWork.relay);

            //Console.WriteLine(marvin.Export());


            Console.ReadLine();
        }
コード例 #8
0
 void Awake()
 {
     Instance = this;
 }
コード例 #9
0
 public void Start()
 {
     lamp    = FindObjectOfType <LampController>();
     machine = FindObjectOfType <Machine1Animation>();
     audio   = FindObjectOfType <Machine1Audio>();
 }