コード例 #1
0
    public static IFriendly getFacilityCaracter(int id, FriendlyCharacterType type, Town livingTown)
    {
        switch (type)
        {
        case MERCHANT:
            return(MerchantMasterManager.getInstance().getMerchantFromId(id, livingTown));

        case CLIENT:
            return(ClientMasterManager.getInstance().getClientFromId(id, livingTown));
        }
        throw new System.ArgumentException("id not found or firendlyCharacter type isn't type of facility owner");
    }
コード例 #2
0
        public Client(int id, Dictionary <FriendlyAbility, int> abilities, int level, Vector3 pos, Quaternion rotate)
        {
            this.id        = id;
            this.level     = level;
            this.abilities = new Dictionary <FriendlyAbility, int>(abilities);

            var builder = ClientMasterManager.getInstance().getClientBuilderFromId(id);

            this.NAME               = builder.getName();
            this.MASSAGES           = builder.getMassges();
            this.UNDERTOOK_MASSAGES = builder.getUnderTookMassges();
            this.CLEAR_MASSAGES     = builder.getClearedMassges();
            this.QUEST_TYPE         = builder.getQuestType();
            this.UNIQUE_ID          = UniqueIdCreator.creatUniqueId();
            var modelPrefab = (GameObject)Resources.Load("Models/" + builder.getModelId());

            container = MonoBehaviour.Instantiate(modelPrefab, pos, rotate).GetComponent <Container>();
            container.setCharacter(this);

            needTown = true;
        }
コード例 #3
0
 void Awake()
 {
     instance     = this;
     netChManager = GetComponent <NetworkCharacterManager>();
 }