示例#1
0
 public void toggleNextScene()
 {
     PrototypeData.SetAllLists();
     PrototypeData.mode     = 1;
     PrototypeData.category = 1;
     Application.LoadLevel("DesignYourCharacter");
 }
示例#2
0
    public UnitEntity SpawnUnit(EntityView entityView)
    {
        if (!cardLookUp.ContainsKey(entityView.prototype))
        {
            throw new System.Exception("Could not find a prototype '" + entityView.prototype);
        }
        PrototypeData prototype = cardLookUp[entityView.prototype];

        if (string.IsNullOrEmpty(prototype.unitPrefab))
        {
            throw new System.Exception("Prototype does not have a unitPrefab associated with it.");
        }
        GameObject prefab = AssetManager.Instance.GetUnitPrefab(prototype.unitPrefab);

        if (prefab == null)
        {
            throw new System.Exception("Could not find prefab '" + prototype.unitPrefab + "'");
        }
        GameObject go   = Instantiate(prefab);
        UnitEntity unit = go.GetComponent <UnitEntity>();

        unit.EntityView = entityView;
        AddEntity(unit);
        if (unit == null)
        {
            Destroy(go);
            throw new System.Exception("Unit prefab did not have UnitEntity component");
        }
        return(unit);
    }
 void Awake()
 {
     PrototypeData.SetAllLists();
     PrototypeData.mode     = 1;
     PrototypeData.category = 1;
     categoryHeader.GetComponent <Text>().text = "Select a feature to edit";
 }
示例#4
0
    public MapObject(string name, Vector3 position, GameObject parent, PrototypeData prototype, bool active)
    {
        Name          = name;
        Parent        = parent;
        Prefab_Name   = prototype.Use_Prefab ? prototype.Prefab_Name : null;
        Material      = prototype.Use_Prefab ? prototype.Material : null;
        Material_Type = prototype.Use_Prefab ? prototype.Material_Type : null;
        Model_Name    = prototype.Use_Prefab ? null : prototype.Model_Name;
        Has_Collision = prototype.Use_Prefab ? false : prototype.Has_Collision;

        GameObject = GameObject.Instantiate(
            prototype.Use_Prefab ? PrefabManager.Instance.Get(prototype.Prefab_Name) : ModelManager.Instance.Get(prototype.Model_Name),
            position,
            Quaternion.identity,
            Parent.transform
            );
        GameObject.name = Name;
        if (!prototype.Use_Prefab)
        {
            BoxCollider collider = GameObject.AddComponent <BoxCollider>();
            collider.isTrigger = !Has_Collision;
        }

        GameObject.SetActive(active);
        Update_Material();
    }
示例#5
0
    void Awake()
    {
        PrototypeData.SetAllLists();
        PrototypeData.mode     = 1;
        PrototypeData.category = 1;
        categoryHeader.GetComponent <Text>().text = "Select a feature to edit";

        allIcons = Resources.LoadAll("Headericons", typeof(Sprite)).Cast <Sprite>().ToArray();
    }
示例#6
0
    public void ShowHoverCard(GameEntity entity)
    {
        PrototypeData proto = GameManager.Instance.GetPrototype(entity.PrototypeId);

        if (proto != null)
        {
            hoverCard.Prototype = proto;
            hoverCard.Show(entity);
        }
    }
示例#7
0
        public static PrototypeData Convert(PrototypeDataJson prototypeDataJson)
        {
            var prototypeData = new PrototypeData
            {
                Id        = prototypeDataJson.Id,
                ProjectId = prototypeDataJson.ProjectId,
                Key       = prototypeDataJson.Key,
                Value     = prototypeDataJson.Value,
                CreatedAt = prototypeDataJson.CreatedAt,
                UpdatedAt = prototypeDataJson.UpdatedAt
            };

            return(prototypeData);
        }
        private async Task getProjectPrototypeData(int projectId)
        {
            IsBusy = true;

            PrototypeData.Clear();

            var client   = new WebClient();
            var response = await client.GetProjectPrototypeData(Project.Id);

            foreach (var item in response.Response.Items)
            {
                PrototypeData.Add(PrototypeDataConverter.Convert(item));
            }

            PrototypeData.Reverse();

            IsBusy = false;
        }
示例#9
0
        /// <summary>
        /// Creates the data for the specified row.
        /// </summary>
        /// <param name="Row">The row.</param>
        internal Data Create(Row Row)
        {
            Data Data;

            switch (this.Index)
            {
            case 0:
            {
                Data = new BuildingData(Row, this);
                break;
            }

            case 1:
            {
                Data = new LocaleData(Row, this);
                break;
            }

            case 2:
            {
                Data = new ResourceData(Row, this);
                break;
            }

            case 3:
            {
                Data = new CharacterData(Row, this);
                break;
            }

            case 6:
            {
                Data = new BuildingClassData(Row, this);
                break;
            }

            case 7:
            {
                Data = new ObstacleData(Row, this);
                break;
            }

            case 8:
            {
                Data = new EffectData(Row, this);
                break;
            }

            case 9:
            {
                Data = new ParticleEmitterData(Row, this);
                break;
            }

            case 10:
            {
                Data = new ExperienceLevelData(Row, this);
                break;
            }

            case 11:
            {
                Data = new TrapData(Row, this);
                break;
            }

            case 12:
            {
                Data = new AllianceBadgeData(Row, this);
                break;
            }

            case 13:
            {
                Data = new GlobalData(Row, this);
                break;
            }

            case 14:
            {
                Data = new TownhallLevelData(Row, this);
                break;
            }

            case 15:
            {
                Data = new PrototypeData(Row, this);
                break;
            }

            case 16:
            {
                Data = new NpcData(Row, this);
                break;
            }

            case 17:
            {
                Data = new DecoData(Row, this);
                break;
            }

            case 18:
            {
                Data = new ResourcePackData(Row, this);
                break;
            }

            case 20:
            {
                Data = new MissionData(Row, this);
                break;
            }

            case 21:
            {
                Data = new BillingPackageData(Row, this);
                break;
            }

            case 22:
            {
                Data = new AchievementData(Row, this);
                break;
            }

            case 25:
            {
                Data = new SpellData(Row, this);
                break;
            }

            case 26:
            {
                Data = new HintData(Row, this);
                break;
            }

            case 27:
            {
                Data = new LandingShipData(Row, this);
                break;
            }

            case 28:
            {
                Data = new ArtifactData(Row, this);
                break;
            }

            case 29:
            {
                Data = new ArtifactBonusData(Row, this);
                break;
            }

            case 30:
            {
                Data = new DeepseaParameterData(Row, this);
                break;
            }

            case 31:
            {
                Data = new ExplorationCostData(Row, this);
                break;
            }

            case 34:
            {
                Data = new ResourceShipData(Row, this);
                break;
            }

            case 35:
            {
                Data = new LootBoxData(Row, this);
                break;
            }

            case 36:
            {
                Data = new LiberatedIncomeData(Row, this);
                break;
            }

            case 37:
            {
                Data = new RegionData(Row, this);
                break;
            }

            case 38:
            {
                Data = new DefenseRewardData(Row, this);
                break;
            }

            case 39:
            {
                Data = new LocatorData(Row, this);
                break;
            }

            case 40:
            {
                Data = new EventData(Row, this);
                break;
            }

            case 41:
            {
                Data = new FootstepData(Row, this);
                break;
            }

            case 42:
            {
                Data = new PersistentEventRewardData(Row, this);
                break;
            }

            case 43:
            {
                Data = new CommunityLinkData(Row, this);
                break;
            }

            case 44:
            {
                Data = new ShieldData(Row, this);
                break;
            }

            case 45:
            {
                Data = new AbTestData(Row, this);
                break;
            }

            case 46:
            {
                Data = new LetterData(Row, this);
                break;
            }

            case 47:
            {
                Data = new RankData(Row, this);
                break;
            }

            case 48:
            {
                Data = new CountryData(Row, this);
                break;
            }

            case 51:
            {
                Data = new BoomboxData(Row, this);
                break;
            }

            case 52:
            {
                Data = new HeroData(Row, this);
                break;
            }

            case 53:
            {
                Data = new HeroAbilityData(Row, this);
                break;
            }

            case 54:
            {
                Data = new OfferData(Row, this);
                break;
            }

            case 55:
            {
                Data = new DeepLinkData(Row, this);
                break;
            }

            case 56:
            {
                Data = new SectorData(Row, this);
                break;
            }

            case 57:
            {
                Data = new SectorBonusData(Row, this);
                break;
            }

            default:
            {
                Data = new Data(Row, this);
                break;
            }
            }

            return(Data);
        }