public void InitializeCharacter(CharacterElement characterElement) { this.characterElement = characterElement; transform.localRotation = Quaternion.Euler(0, 90 * (int)characterElement.facingDirection, 0); currentModelType = characterElement.modelType; InitializeMapElement(characterElement.mapElement); isInitialized = true; }
public CharacterElement(MapElement mapElement, string name, int speed, int jumpHeight, CharacterModelType modelType, FacingDirection facingDirection = FacingDirection.North, bool hasMoved = false, bool hasActed = false) { this.mapElement = mapElement; this.name = name; this.speed = speed; this.jumpHeight = jumpHeight; this.modelType = modelType; this.facingDirection = facingDirection; this.hasMoved = hasMoved; this.hasActed = hasActed; }
public GameObject GetModelByType(CharacterModelType ModelType) { GameObject Model; if(!Models.ContainsKey(ModelType)) { GameObject LoadedModel = Resources.Load("Characters/" + GetModelNameByType(ModelType)) as GameObject; Models.Add(ModelType, LoadedModel); } Model = GameObject.Instantiate(Models[ModelType]); return Model; }
public CharacterSpecialCustomInfo(uint nameColor, CharacterModelType modelType, uint coloredNameChecksum) { if (!Enum.IsDefined(typeof(CharacterModelType), modelType)) { throw new InvalidEnumArgumentException(nameof(modelType), (int)modelType, typeof(CharacterModelType)); } NameColor = nameColor; ModelType = modelType; ColoredNameChecksum = coloredNameChecksum; }
protected string GetModelNameByType(CharacterModelType ModelType) { string ModelName; switch(ModelType) { case CharacterModelType.MALE_SOLDIER: { ModelName = "MaleSoldier"; break; } default: { ModelName = "MaleSoldier"; break; } } return ModelName; }
public void SetModelType(CharacterModelType TypeOfModel) { ModelType = TypeOfModel; }
public ObjectData() { ModelType = CharacterModelType.MALE_SOLDIER; }
public CharacterElement(int x, int y, int height, string name, int speed, int jumpHeight, CharacterModelType modelType, FacingDirection facingDirection = FacingDirection.North, bool hasMoved = false, bool hasActed = false) : this(new MapElement(x, y, height, MapElementType.Character), name, speed, jumpHeight, modelType, facingDirection, hasMoved, hasActed) { }