Ejemplo n.º 1
0
        void AddAlarmToNode(GameObject parentnode, string alarmname, string nodename, float almheight = 2)
        {
            var lc   = bm.sman.linkcloudman;
            var lclc = lc.GetGraphCtrl();

            if (!lc.IsNodeName(nodename))
            {
                return;
            }

            var nodept = lclc.GetNode(nodename);

            if (nodept == null)
            {
                return;
            }

            var pt   = nodept.pt;
            var apos = new Vector3(pt.x, pt.y + almheight, pt.z);
            var ago  = BldEvacAlarm.GetGo(alarmname, apos, 1.0f);

            ago.transform.parent = parentnode.transform;
            var beac = ago.AddComponent <BldEvacAlarm>();

            beac.Init(this, apos);
        }
Ejemplo n.º 2
0
        public void CreateGos()
        {
            alarmgo = new GameObject("alarms");
            alarmgo.transform.parent = transform;

            var ago1 = BldEvacAlarm.GetGo("AllFreeAlarm1", apt1, 1);
            var ago2 = BldEvacAlarm.GetGo("AllFreeAlarm2", apt2, 1);

            ago1.transform.parent = alarmgo.transform;
            ago2.transform.parent = alarmgo.transform;
            var alarm1 = ago1.AddComponent <BldEvacAlarm>();
            var alarm2 = ago2.AddComponent <BldEvacAlarm>();

            alarm1.Init(this, apt1);
            alarm2.Init(this, apt2);

            if (showZoneDefinitionMarkers)
            {
                var ptgo1 = GraphAlgos.GraphUtil.CreateMarkerSphere(name + "p1 - start", zpt1, clr: "darkgreen", size: 0.2f);
                var ptgo2 = GraphAlgos.GraphUtil.CreateMarkerSphere(name + "p2 - stop", zpt2, clr: "darkred", size: 0.2f);
                ptgo2.transform.parent = alarmgo.transform;
                ptgo1.transform.parent = alarmgo.transform;
            }

            foreach (var slt in slots.Keys)
            {
                slots[slt].CreateGos();
            }
        }