Ejemplo n.º 1
0
        public void GenerateOnDeserialize(CellEvent instance)
        {
            this.cellMapper.Add(instance, instance.Origin);
            instance.Initialize(instance.Origin, true);

            Broker.Global.Publish(AddedCellEvent.Get(instance));
        }
Ejemplo n.º 2
0
        public void Generate(Cell cell, int cellEventRecordId, bool isInitializingGame)
        {
            Assert.IsFalse(this.cellMapper.HasEvent(cell));

            var gameSystem      = GameSystem.Instance;
            var cellEventRecord = gameSystem.MasterData.CellEvent.Records.Get(cellEventRecordId);

            Assert.IsNotNull(cellEventRecord);
            Assert.IsNotNull(cellEventRecord.EventData);

            var cellEventInstance = UnityEngine.Object.Instantiate(cellEventRecord.EventData);

            // (Clone)という文字列が要らないのでnameを代入する必要がある
            cellEventInstance.name = cellEventRecord.EventData.name;
            cellMapper.Add(cellEventInstance, cell.Position);
            cellEventInstance.Initialize(cell.Position, isInitializingGame);

            gameSystem.User.History.GenerateCellEvent.Add(cellEventRecordId, 0);

            Broker.Global.Publish(AddedCellEvent.Get(cellEventInstance));
        }