private void GetBuff(BuffType buff, CharacterStatus status) { ; Material buffMat = Resources.Load("Debuff/" + buff.ToString()) as Material; switch (buff) { case BuffType.SlowDown: if (buffMat != null) { GameTool.FindTheChild(gameObject, "Base").GetComponent <SkinnedMeshRenderer>().material = buffMat; } status.moveSpeed *= 0.7f; break; case BuffType.Freeze: if (buffMat != null) { GameTool.FindTheChild(gameObject, "Base").GetComponent <SkinnedMeshRenderer>().material = buffMat; } status.moveSpeed *= 0.001f; break; case BuffType.Blind: Camera.main.GetComponent <BlindEffect>().enabled = true; break; } }
public void OnEnable() { IsOverhead = Unit as Player == null; switch (BarType) { case BuffType.HP: this.SmoothAmmount = Unit.HP; this.Unit.HPChanged += UpdateFillAmount; break; case BuffType.FP: Player player = Unit as Player; if (!player) { Debug.Log("This unit is not a player and does not have an FP associated with it"); return; } this.SmoothAmmount = player.FP; player.FPChanged += UpdateFillAmount; break; default: Debug.Log("This type of bar is not supported : " + BarType.ToString()); break; } DisplayFillAmmount(); }
public void BuffActivate(Item item) { if (eventController == null) { eventController = Global.Component.GetEventController(); } if (buffController == null) { buffController = Global.Component.GetBuffController(); } if (buffController.IsBuffExist(item) == false) { Type type = Type.GetType(buffType.ToString()); IBuff buff = (IBuff)Activator.CreateInstance(type); buff.Buff(); } eventController.OnAddBuffEvent.Invoke(item); }
public void Create(BuffType buffType, float buffAmount) { GameObject buffObject = Instantiate(Game.Ctx.CardOperator.buffPrefab, transform); buffObject.name = buffType.ToString("g"); Buff buff = buffObject.GetComponent <Buff>(); buff.Initialize(buffType, buffAmount); BuffList.Add(buff); AdjustAllPositions(); }
public void LogBuff(byte state, long expire, BuffType bType) { Action action = new Action { Task = "Log Buff", AddedInfo = state == 0 ? string.Format("[LOGIN] Buff {0} expires in {1} Seconds", bType.ToString(), expire / 1000) : state == 1 ? string.Format("[LOGOUT] Buff {0} expires in {1} Seconds", bType.ToString(), expire / 1000) : state == 2 ? string.Format("[PAUSE] Buff {0} has been paused, {1} seconds remaining", bType.ToString(), expire) : state == 3 ? string.Format("[UNPAUSE] Buff {0} has been unpaused with {1} seconds remaining", bType.ToString(), expire / 1000) : string.Format("[RemoveBuff] Buff {0} Expired.", bType.ToString()) }; RecordAction(action); }
BuffData buffData; // 버프데이터 객체 /// <summary> /// 초기화 진행 함수 /// </summary> public override void InitializeSlot() { // 버프 타입에 따른 스프라이트 설정 itemSprite = GameManager.Instance.SpriteSetManager.GetSprite(buffType.ToString()); // 무기 타입에 따른 스프라이트 설정 weaponIcon.sprite = GameManager.Instance.SpriteSetManager.GetSprite(weaponStyle.ToString()); base.InitializeSlot(); // 캐싱 BuffManager buffManager = GameManager.Instance.BuffManager; buffData = buffManager.GetBuffData(weaponStyle, buffType); saveData = GameManager.Instance.DataBase.SaveData; }
public static IBuff GetIBuffByType(BuffType buffType) { Type type = Type.GetType(buffType.ToString()); return((IBuff)Activator.CreateInstance(type)); }
public static FieldName GetFieldNameAttribute(this BuffType buffType) { return(Attribute.GetCustomAttribute(typeof(BuffType).GetField(buffType.ToString()), typeof(FieldName)) as FieldName); }