Пример #1
0
        private void InstantiateZoneControls()
        {
            List <ZoneGraphic> allZones = GetAllZones(_graphicConfiguration);
            int columCount;
            int rowCount;

            ConfigureMainGrid(allZones.Count, out columCount, out rowCount);

            int columnIndex = 0;
            int rowIndex    = 0;

            foreach (ZoneGraphic zone in allZones)
            {
                ZoneControl zoneCtrl = new ZoneControl();
                zoneCtrl.Zone              = zone;
                zoneCtrl.Sources           = _graphicConfiguration.Sources;
                zoneCtrl._zoneStateChange += new RoutedEventHandler(zoneCtrl__zoneStateChange);
                _gridMain.Children.Add(zoneCtrl);
                _zoneControlByAddress.Add(zone.Id, zoneCtrl);
                Grid.SetColumn(zoneCtrl, columnIndex++);
                Grid.SetRow(zoneCtrl, rowIndex);

                if (columnIndex == columCount)
                {
                    columnIndex = 0;
                    rowIndex++;
                }
            }
        }
Пример #2
0
 //Upon exit, revert effects of enemy
 void OnTriggerExit2D(Collider2D entity)
 {
     if (entity.tag == enemyTag)
     {
         effected.Remove(entity);
         ZoneControl zoneMove = (ZoneControl)currentMove;
         zoneMove.revertEffects(entity);
     }
 }
Пример #3
0
 void Awake()
 {
     zoneControl = transform.parent.GetComponent <ZoneControl>();
     // Find the Particle systems
     primaryParticle   = GetComponent <ParticleSystem>();
     secondaryParticle = primaryParticle.transform.GetChild(0).GetComponent <ParticleSystem>();
     splashParticle    = secondaryParticle.transform.GetChild(0).GetComponent <ParticleSystem>();
     // Find the renderers
     primaryRenderer   = GetComponent <Renderer>();
     secondaryRenderer = primaryParticle.transform.GetChild(0).GetComponent <Renderer>();
     splashRenderer    = secondaryParticle.transform.GetChild(0).GetComponent <Renderer>();
 }
Пример #4
0
    void Awake()
    {
        zone               = GameObject.FindGameObjectWithTag("Zone");
        zoneControl        = zone.GetComponent <ZoneControl>();
        zoneManager        = zone.transform.parent.GetComponent <ZoneManager>();
        playerColourPicker = GetComponent <PlayerColourPicker>();

        for (int i = 0; i < 4; i++)
        {
            outerSpawns[i]  = outerSpawnParent.transform.GetChild(i);
            centreSpawns[i] = centerSpawnParent.transform.GetChild(i);
            sliders[i]      = scoreObjects[i].GetComponentInChildren <Slider>();
        }
    }
Пример #5
0
 private void AsyncAddControl(ZoneControl pZoneControl)
 {
     if (this.InvokeRequired)
     {
         Action <Form> actionAddrCtrl = (X) =>
         {
             X.Controls.Add(pZoneControl);
         };
         Invoke(actionAddrCtrl, this);
     }
     else
     {
         this.Controls.Add(pZoneControl);
     }
 }
Пример #6
0
 public override void OnInspectorGUI()
 {
     DrawDefaultInspector();
     if (GUILayout.Button("Set product list and powerup list"))
     {
         SetProductList();
         SetPowerUpList();
         ZoneControl zc = FindObjectOfType <ZoneControl>();
         if (zc)
         {
             zc.SetProductsInZone();
         }
         Debug.LogWarning("Successfully set lists, don't forget to save!");
     }
 }
Пример #7
0
 void zoneCtrl__zoneStateChange(object sender, RoutedEventArgs e)
 {
     try
     {
         ZoneControl zoneCtrl = sender as ZoneControl;
         if (zoneCtrl != null)
         {
             _monitorAndControlProxy.SetZoneState(zoneCtrl.Zone.Id, zoneCtrl.ZoneStateCmd);
         }
     }
     catch (Exception)
     {
         _monitorAndControlProxy.Abort();
     }
 }
Пример #8
0
        private void LoadingInspectorData()
        {
            List <Inspector> pList = InspectorsLab.getInstance().InspectorList;

            foreach (Inspector isp in pList)
            {
                if (!m_pZoneControlList.Keys.Contains(isp.UUID))
                {
                    ZoneControl pZoneControl = new ZoneControl();
                    pZoneControl.UUID = isp.UUID;
                    pZoneControl.Dock = DockStyle.Top;
                    pZoneControl.Show();
                    pZoneControl.InitializeZoneInfo();
                    pZoneControl.OnRemoveEvent += new RemoveZoneControlDelgate(pZoneControl_OnRemoveEvent);
                    AsyncAddControl(pZoneControl);
                    m_pZoneControlList.Add(isp.UUID, pZoneControl);
                }
            }
        }
Пример #9
0
    // Use this for initialization
    void Start()
    {
        curveName = kurve.name;
        gg = GameObject.Find("0 Toggle GG").GetComponent<ToggleGG>();
        hint = GameObject.Find(curveName + "_hint");
        looked = false;
        exit = false;
        frame = 0;
        show = true;
        hintActive = false;
        curvePre = curveName.Split('_')[0];
        zc = GameObject.Find(curvePre).GetComponent<ZoneControl>();
        car = GameObject.FindGameObjectWithTag("Player").GetComponent<CarController>();
        wps = GetAllWaypoints();
        currentWaypoint = 0;
        hint.transform.position = wps[0];
        inTrigger = false;
        lockframes = 0;
        tt = GameObject.Find("StartGoal").GetComponent<TriggerTimer>();
        sb = new StringBuilder();
        headSet = false;

        /*

        filename = TriggerTimer.filename;
        string tmp = filename.Split('.')[0];
        filename = tmp + "_gaze.csv";

        if (!File.Exists(TriggerTimer.path + filename))
        {
            string head = string.Format("{0},{1},{2},{3},{4},{5},{6}{7}", "Zone","Round", "Time", "PosHint", "PosGaze", "Distance", "CarSpeed", Environment.NewLine);
            sb.Append(head);
        }

        */

        if (gameObject.name.Equals(curvePre + "_1_Trigger"))
        {
            isFirst = true;
        }
        else
        {
            isFirst = false;
        }
    }
Пример #10
0
 private void Awake()
 {
     currentZoneIndex = 0;
     zc_Single        = this;
 }
Пример #11
0
 private void Awake()
 {
     zoneControl = GetComponent <ZoneControl>();
     Randomize();
 }