Exemplo n.º 1
0
        public static Unit CreateEmitObj(long id, GameObject go, UnitData unitData)
        {
            EmitObjUnitComponent unitComponent = Game.Scene.GetComponent <EmitObjUnitComponent>();
            Unit unit = ComponentFactory.CreateWithId <Unit, GameObject>(id, go);

            if (!GlobalConfigComponent.Instance.networkPlayMode)
            {
                AddCollider(unit, unitData, true);
            }
            unit.AddComponent <EmitObjMoveComponent>();
            unitComponent.Add(unit);
            return(unit);
        }
        public override void Dispose()
        {
            if (this.IsDisposed)
            {
                return;
            }
            base.Dispose();

            foreach (Unit unit in this.idUnits.Values)
            {
                unit.Dispose();
            }

            this.idUnits.Clear();

            Instance = null;
        }
 public void Awake()
 {
     Instance = this;
 }