コード例 #1
0
    void Start()
    {
        cartController   = cartObject.GetComponent <CartController>();
        switchController = switchObject.GetComponent <SwitchController>();

        leftPath.SetActive(switchState == SwitchMachineState.SwitchMachineLeft);
        rightPath.SetActive(switchState == SwitchMachineState.SwitchMachineRight);
    }
コード例 #2
0
 public TestRunner(SwitchController sc,
                   NetworkAnalyzer av,
                   Oscillograph osc)
 {
     this.av  = av;
     this.osc = osc;
     this.sc  = sc;
 }
コード例 #3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #4
0
    private void performActionSwitch(GameObject switchObj)
    {
        SwitchController controller = switchObj.GetComponent <SwitchController>();

        if (Input.GetKeyDown(KeyCode.K))
        {
            GameController.usingGameAction = true;
            controller.ActionSwitch();
            //Debug.Log("ACTION Switch");
        }
    }
コード例 #5
0
 private void Start()
 {
     switchController = GetComponent <SwitchController>();
     player           = FindObjectOfType <PlayerController>();
     if (player == null)
     {
         Debug.LogError("Can't find the player object");
     }
     PlayerController.OnItemCarried += OnItemCarried;
     PlayerController.OnItemDropped += OnItemDropped;
 }
コード例 #6
0
 // Use this for initialization
 void Start()
 {
     //Transform content = transform.Find ("Scroll View").Find ("Viewport").Find ("Content");
     this.switchReplay = transform.Find("Container").Find("SaveEnabled").Find("Switch").GetComponent<SwitchController>();
     this.switchReplay.AddListener(OnSwitchChange);
     this.switchReplay.Value = Settings.Instance.AllowReplayBackup;
     this.emptyBackup = transform.Find("Container").Find("EmptyBackup").Find("Button").GetComponent<Button>();
     this.emptyBackup.onClick.AddListener(delegate ()
     {
         OnEmptyBackup();
     });
 }
コード例 #7
0
ファイル: SwitchManager.cs プロジェクト: KensukeMori/torch
 //各スイッチにsequenceDataを振り分ける
 public void SetGhost(List <SequenceData> sequenceList)
 {
     for (int i = 0; i < sequenceList.Count(); i++)
     {
         if (i < m_SwitchList.Count())
         {
             SwitchController sSwitchController = m_SwitchList[i].GetComponent <SwitchController>();
             sSwitchController.m_itemList = sequenceList[i].itemList;
             Debug.Log("データをswitchに振り分けました");
         }
     }
 }
コード例 #8
0
    private void TouchEndedHandler(TouchInfo touchInfo)
    {
        if (catchSwitchState == null)
        {
            return;
        }

        var delta = touchInfo.TouchPosition.x - previewPosition;

        ProcessingSwitch(delta);
        catchSwitchState = null;
    }
コード例 #9
0
    private void Start()
    {
        for (int i = 0; i < 3; i++)
        {
            for (int j = 0; j < 2; j++)
            {
                SwitchController controller = Instantiate(switchControllerPrefab) as SwitchController;
                switchController[i, j] = controller;
            }
        }

        SetLevel();
        SetSwitchController();
    }
コード例 #10
0
        private bool OpenSwitch(int id)
        {
            try
            {
                SwitchController.Open(id);
                SwitchController.Default.Initialize();
            }
            catch (CustomException e)
            {
                return(false);
            }

            return(true);
        }
コード例 #11
0
        public MainPage()
        {
            this.settings = new Settings();
            this.settings.SelectedPresetChanged += new SelectedPresetChangedHandler(settings_SelectedPresetChanged);
            this.controller = new SwitchController(this.settings);
            this.webServer  = new WebServer(this.settings);

            this.DataContext = this.settings;
            this.InitializeComponent();

            this.presetButtons = new ExclusiveToggleButtonSet(
                this.presetButton0,
                this.presetButton1,
                this.presetButton2,
                this.presetButton3,
                this.presetButton4,
                this.presetButton5,
                this.presetButton6,
                this.presetButton7,
                this.presetButton8,
                this.presetButton9,
                this.presetButton10,
                this.presetButton11,
                this.presetButton12,
                this.presetButton13,
                this.presetButton14,
                this.presetButton15
                );
            presetButtons.ItemSelected += new ItemSelectedHandler(preset_ItemSelected);


            new ExclusiveToggleButtonSet(
                this.previewButton0,
                this.previewButton1,
                this.previewButton2,
                this.previewButton3,
                this.previewButton4,
                this.previewButton5,
                this.previewButton6,
                this.previewButton7
                ).ItemSelected += new ItemSelectedHandler(preview_ItemSelected);

            this.webServer.Start();

            DispatcherTimer timer = new DispatcherTimer();

            timer.Tick    += Timer_Tick;
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Start();
        }
コード例 #12
0
ファイル: GameManager.cs プロジェクト: zapoutix/StayInLight
        public void OnToggleSwitch(SwitchController sw)
        {
            if (_door.IsOpen)
            {
                return;
            }

            if (_switches.Any(o => !o.Switched))
            {
                return;
            }

            _door.Open();
            _camera.Shake();
        }
コード例 #13
0
ファイル: Program.cs プロジェクト: Squikle/Design-Patterns
        static void Main()
        {
            SwitchController controller = new SwitchController(new Tv(), new OnCommand());

            controller.Action();
            controller.Command = new OffCommand();
            controller.Action();

            controller.Device  = new Fan();
            controller.Command = new OnCommand();
            controller.Action();
            controller.Undo();

            Console.ReadKey();
        }
コード例 #14
0
    void Start()
    {
        switch01   = GameObject.Find("switch_1");
        switch02   = GameObject.Find("switch_2");
        switch03   = GameObject.Find("switch_3");
        switchDoor = GameObject.Find("switch_door");
        switch04   = GameObject.Find("switch_4");


        water00 = GameObject.Find("water_00");
        water01 = GameObject.Find("water_01");
        water02 = GameObject.Find("water_02");

        boat       = GameObject.Find("boat");
        player     = GameObject.Find("player");
        mainCamera = GameObject.Find("Main Camera");

        offset = transform.position - mainCamera.transform.position;

        s1 = switch01.GetComponent <SwitchController>();
        s2 = switch02.GetComponent <SwitchController>();
        s3 = switch03.GetComponent <SwitchController>();
        s4 = switch04.GetComponent <SwitchController>();

        sd = switchDoor.GetComponent <SwitchController>();

        w0 = water00.GetComponent <WaterController>();
        w1 = water01.GetComponent <WaterController>();
        w2 = water02.GetComponent <WaterController>();

        bc = boat.GetComponent <BoatController>();
        pc = player.GetComponent <PlyrMoveController>();
        cc = mainCamera.GetComponent <CameraController>();

        gameElements = GameObject.Find("GameElements");
        menuposition = GameObject.Find("menuposition");

        //clone.transform.position = cannon.transform.position;

        items = new List <GameObject>();
        items.Add(createLife());
        items.Add(createLife());
        items.Add(createLife());

        //MountMenu();

        goToSavePoint();
    }
コード例 #15
0
 public void ActivateSwitch(SwitchController s)
 {
     if (switches[index] == s.GetComponent <SwitchController>())
     {
         index += 1;
         if (index == switches.Length - 1)
         {
             unlocker.Unlock();
             unlocked = true;
         }
     }
     else
     {
         index = 0;
     }
 }
コード例 #16
0
    private void ProcessingSwitch(float delta)
    {
        if (Math.Abs(delta) < 0.1f)
        {
            catchSwitchState = null;
            return;
        }

        if (delta > 0)
        {
            catchSwitchState.SetNextState();;
        }
        else
        {
            catchSwitchState.SetPreviewState();
        }
    }
コード例 #17
0
    private void TouchBeganHandler(TouchInfo touchInfo)
    {
        if (!TouchController.LockTouchObject.activeSelf)
        {
            return;
        }
        if (touchInfo.HitObject == null || touchInfo.HitObject.parent == null)
        {
            return;
        }
        catchSwitchState = touchInfo.HitObject.parent.GetComponent <SwitchController>();
        if (catchSwitchState == null)
        {
            return;
        }

        previewPosition = touchInfo.TouchPosition.x;
    }
コード例 #18
0
ファイル: GameManager.cs プロジェクト: GyyBest/hezi
    public void CheckAllSwitchesState()
    {
        bool oneSwitchOff = false;

        foreach (GameObject switchObj in switches)
        {
            SwitchController switchController = switchObj.GetComponent <SwitchController>();
            if (!switchController.switchOn)
            {
                oneSwitchOff = true;
                break;
            }
        }
        if (!oneSwitchOff)
        {
            gameHud.finish = true;
        }
    }
コード例 #19
0
 private void Start()
 {
     _cCtrl         = GetComponentInParent <ChassisController>();
     _redSwitchCtrl = _redSwitch.GetComponent <SwitchController>();
     isRecording    = _redSwitchCtrl.isOn;
 }
コード例 #20
0
ファイル: RubiControllerScript.cs プロジェクト: kieryst/Rubi
 void OnTriggerExit2D(Collider2D collider)
 {
     if (collider.gameObject.tag == "SavePoint") {
         saveActive = false;
     }
     if (collider.gameObject.tag == "Switch") {
         switchActive = false;
         currSwitch = null;
     }
 }
コード例 #21
0
ファイル: RubiControllerScript.cs プロジェクト: kieryst/Rubi
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.gameObject.tag == "SavePoint") {
         saveActive = true;
     }
     if (collider.gameObject.tag == "Switch") {
         switchActive = true;
         currSwitch = collider.gameObject.GetComponent<SwitchController>();
     }
 }
コード例 #22
0
ファイル: PlayerSearch.cs プロジェクト: nyuyoku1117/LostGear
    // Update is called once per frame
    void Update()
    {
        if (CollisionFlag == true)
        {
            Balloon.SetActive(true);
            if (Input.GetKeyDown(KeyCode.C))
            {
                if (SwitchFlag == true)
                {
                    SwitchController Switch = obj.gameObject.GetComponent <SwitchController> ();
                    Switch.TurnSwitch();
                }
                else if (RockFlag == true)
                {
                    obj.gameObject.SetActive(false);
                }
                else if (Switch_GarekiFlag == true)
                {
                    SwitchController Switch = obj.gameObject.GetComponent <SwitchController>();
                    Switch.TurnSwitch();
                    obj.SetActive(false);
                }
                else if (BridgeFlag == true)
                {
                    BridgeController Bridge = obj.gameObject.GetComponent <BridgeController>();
                    Bridge.BridgeAction();
                }
                else if (PCFlag == true)
                {
                    if (PC.player == PlayerControler.playerType.Ed)
                    {
                        PC.player = PlayerControler.playerType.Dola;
                    }
                    else
                    {
                        PC.player = PlayerControler.playerType.Ed;
                    }
                }
                else if (doorFlag == true)
                {
                    doorController dc = obj.gameObject.GetComponent <doorController>();
                    dc.Moving();
                }
                else if (waterFlag == true)
                {
                    waterType++;
                    waterType %= 4;
                    switch (waterType)
                    {
                    case 0:
                        water.Event = WaterController.eventType.BtoA;
                        break;

                    case 1:
                        water.Event = WaterController.eventType.AtoB;
                        break;

                    case 2:
                        water.Event = WaterController.eventType.BtoC;
                        break;

                    case 3:
                        water.Event = WaterController.eventType.CtoB;
                        break;
                    }
                    water.EventFlag = true;
                }
                else if (keyFlag == true)
                {
                    if (KC.open == true)
                    {
                        KC.gateClose();
                    }
                    else
                    {
                        KC.gateOpen();
                    }
                }
            }
        }
        else
        {
            Balloon.SetActive(false);
        }
    }
        public void SetUp()
        {
            _switchResourceBuilder = new SwitchResourceBuilder()
                                     .WithDefaultGasDetailedEstimateItems()
                                     .WithDefaultElectricityDetailedEstimateItems()
                                     .WithLinks(CreateDefaultLinks());

            _usageDataBuilder = new ResourceBuilder()
                                .WithDataTemplate()
                                .WithGroup("gasSimpleEstimate")
                                .WithItem("simpleEstimate")
                                .WithAcceptableValue("1", "Low (small flat) gas")
                                .WithAcceptableValue("2", "Medium (house or large flat) gas")
                                .WithAcceptableValue("3", "High (large house) gas")
                                .WithGroup("gasDetailedEstimate")
                                .WithItem("houseType")
                                .WithAcceptableValue("Value 1", "Name 1")
                                .WithItem("numberOfBedrooms")
                                .WithAcceptableValue("Value 3", "Name 3")
                                .WithItem("mainCookingSource")
                                .WithAcceptableValue("Value 5", "Name 5")
                                .WithItem("cookingFrequency")
                                .WithAcceptableValue("Value 7", "Name 7")
                                .WithItem("centralHeating")
                                .WithAcceptableValue("Value 9", "Name 9")
                                .WithItem("numberOfOccupants")
                                .WithAcceptableValue("Value 11", "Name 11")
                                .WithItem("insulation")
                                .WithAcceptableValue("Value 13", "Name 13")
                                .WithItem("energyUsage")
                                .WithAcceptableValue("Value 15", "Name 15")
                                .WithGroup("elecSimpleEstimate")
                                .WithItem("simpleEstimate")
                                .WithAcceptableValue("1", "Low (small flat) elec")
                                .WithAcceptableValue("2", "Medium (house or large flat) elec")
                                .WithAcceptableValue("3", "High (large house) elec")
                                .WithGroup("elecDetailedEstimate")
                                .WithItem("houseType")
                                .WithAcceptableValue("Value 2", "Name 2")
                                .WithItem("numberOfBedrooms")
                                .WithAcceptableValue("Value 4", "Name 4")
                                .WithItem("mainCookingSource")
                                .WithAcceptableValue("Value 6", "Name 6")
                                .WithItem("cookingFrequency")
                                .WithAcceptableValue("Value 8", "Name 8")
                                .WithItem("centralHeating")
                                .WithAcceptableValue("Value 10", "Name 10")
                                .WithItem("numberOfOccupants")
                                .WithAcceptableValue("Value 12", "Name 12")
                                .WithItem("insulation")
                                .WithAcceptableValue("Value 14", "Name 14")
                                .WithItem("energyUsage")
                                .WithAcceptableValue("Value 16", "Name 16");

            _apiClient = Substitute.For <IApiClient>();
            StubSwitchResource();

            var modelLoader = new ModelRepository(_apiClient, Substitute.For <IConfiguration>());

            _sut = new SwitchController(modelLoader);
        }
コード例 #24
0
 public Macro(SwitchController controller)
 {
     m_controller = controller;
 }
コード例 #25
0
 // Start is called before the first frame update
 void Start()
 {
     switchController = Switch.GetComponent <SwitchController>();
     playerController = GameObject.Find("Player").GetComponent <PlayerController>();
     Smokes           = GameObject.Find("Smokes");
 }
コード例 #26
0
ファイル: SwitchScript.cs プロジェクト: Vipkry/Runner3
 void Start()
 {
     switchControllerScript = GameObject.FindGameObjectWithTag("SwitchController").GetComponent<SwitchController>();
     buttonSwitchAudioSource = GameObject.FindGameObjectWithTag("SwitchAudio").GetComponent<AudioSource>();
 }
コード例 #27
0
 // Start is called before the first frame update
 void Start()
 {
     switchController = GameObject.FindWithTag("Switch").GetComponent <SwitchController>();
     switchController.switchPressed += TurnLight;
 }
コード例 #28
0
        public static SwitchController Fixture()
        {
            SwitchController controller = new SwitchController(new SwitchRepository(), "", new LoginView());

            return(controller);
        }
コード例 #29
0
ファイル: LaserScript.cs プロジェクト: Vipkry/Runner3
 void Start()
 {
     // Pega o Switch Controller
     switchControllerScript = GameObject.FindGameObjectWithTag("SwitchController").GetComponent<SwitchController>();
     // Pega o objeto do player
     player = GameObject.FindGameObjectWithTag("Player");
     // Pega o objeto do playerLaserControllerScript
     playerLaserContollerScript = player.GetComponent<PlayerLaserController>();
     // Pega a força do tiro
     laserForce = playerLaserContollerScript.laserForce;
     // Pega o objeto do Renderer do player
     playerRenderer = player.GetComponent<Renderer>();
     // Muda a cor do tiro se necessário
     CorDoTiro();
     // Atira
     Atira();
 }
コード例 #30
0
ファイル: SwitchTests.cs プロジェクト: netusers2014/mixerp
 public static SwitchController Fixture()
 {
     SwitchController controller = new SwitchController(new SwitchRepository(), "", new LoginView());
     return controller;
 }
コード例 #31
0
 // Start is called before the first frame update
 void Start()
 {
     switchParent     = transform.root.gameObject;
     switchController = switchParent.GetComponent <SwitchController>();
 }