예제 #1
0
        public void Init(long[] values, TriggerManger.TriggerDefine td)
        {
            triggerDefine = td;
            name          = td.NAME;
            for (int i = 0; i < td.argDefines.Count; i++)
            {
                Arg arg = new Arg(mapData);
                arg.IsInit = false;

                arg.argDefine = td.argDefines[i];

                arg.ARGTYPE = td.argDefines[i].argtype;
                long value = values[td.argDefines[i].pos];

                switch (arg.ARGTYPE)
                {
                case TriggerManger.ArgType.WAV:
                case TriggerManger.ArgType.STRING:
                    arg.STRING = new StringData(mapData, (int)value);
                    break;

                case TriggerManger.ArgType.LOCATION:
                    arg.LOCATION = mapData.LocationDatas.SingleOrDefault((x) => x.INDEX == (int)value);
                    if (arg.LOCATION == null)
                    {
                        LocationData locationData = new LocationData(mapData.mapEditor);

                        locationData.INDEX         = (int)value;
                        locationData.STRING.String = "자동생성 로케이션 " + value;



                        mapData.LocationDatas.Add(locationData);
                        arg.LOCATION = locationData;
                    }
                    break;

                case TriggerManger.ArgType.UPRP:
                    arg.UPRP = mapData.UPRP[value - 1];
                    break;

                default:
                    arg.VALUE = value;
                    break;
                }
                args.Add(arg);
            }

            if (name == "SetDeaths")
            {
                MemoryFunc.ApplyMemoryFunc(this);
            }
            else if (name == "Deaths")
            {
                MemoryFunc.ApplyMemoryFunc(this);
            }
        }
예제 #2
0
        public void Init(TriggerManger.TriggerDefine td)
        {
            args.Clear();
            triggerDefine = td;
            name          = td.NAME;
            type          = td.TYPE;
            for (int i = 0; i < td.argDefines.Count; i++)
            {
                Arg arg = new Arg(mapData);

                arg.argDefine = td.argDefines[i];

                arg.ARGTYPE = td.argDefines[i].argtype;
                args.Add(arg);
            }
        }