private void UpdateHP(HCI_Project.Library.Avatar avatar) { if (avatar.HP / (float)avatar.MaxHP < hpScrollbar.size) { damaged = true; } hpScrollbar.size = avatar.HP / (float)avatar.MaxHP; }
private void Avatar_OnHP_Changed(HCI_Project.Library.Avatar avatar) { if (avatar.HP <= 0) { anim.SetTrigger("Die"); playerMovement.enabled = false; attackController.enabled = false; StartCoroutine(Restart()); } }
private void OnDestroy() { HCI_Project.Library.Avatar avatar = Global.Avatar; avatar.OnHP_Changed -= UpdateHP; avatar.OnMaxHP_Changed -= UpdateHP; avatar.OnMP_Changed -= UpdateMP; avatar.OnMaxMP_Changed -= UpdateMP; avatar.OnLevelChanged -= UpdateLevel; avatar.OnEXP_Changed -= UpdateEXP; avatar.OnMaxEXP_Changed -= UpdateEXP; }
private void Avatar_OnLevelChanged(HCI_Project.Library.Avatar avatar) { List <Skill> skills = SkillTable.RandomTakeUpgradableSkills(avatar, 3).ToList(); Time.timeScale = 0; Global.Player.RequestManager.RemoteOperation(Global.DeviceCode, (byte)RemoteOperationCode.ShowUpgradeSkillPanel, new System.Collections.Generic.Dictionary <byte, object> { { 0, skills[0].SkillID }, { 1, skills[1].SkillID }, { 2, skills[2].SkillID } }); }
public void Fire(HCI_Project.Library.Avatar avatar) { reloadTimer = avatar.ReloadTimeSpan; for (int i = 0; i < avatar.MissileNumber; i++) { FireProjectileScript fireball = Instantiate(fireballPrefab, transform); fireball.transform.Rotate(0, avatar.MissileNumber / 2 * -5 + 10 * i, 0); fireball.ProjectileColliderSpeed = avatar.MissileSpeed / 2; ParticleSystem fireParticleSystem = fireball.transform.Find("FireboltParticle").GetComponent <ParticleSystem>(); fireParticleSystem.startSpeed = avatar.MissileSpeed / 2; fireParticleSystem.startSize = avatar.MissleRadius * 5; fireball.transform.Find("FireboltCollider").GetComponent <SphereCollider>().radius = avatar.MissleRadius * 2; } }
private void Start() { HCI_Project.Library.Avatar avatar = Global.Avatar; avatar.OnHP_Changed += UpdateHP; avatar.OnMaxHP_Changed += UpdateHP; avatar.OnMP_Changed += UpdateMP; avatar.OnMaxMP_Changed += UpdateMP; avatar.OnLevelChanged += UpdateLevel; avatar.OnEXP_Changed += UpdateEXP; avatar.OnMaxEXP_Changed += UpdateEXP; UpdateHP(avatar); UpdateMP(avatar); UpdateLevel(avatar); UpdateEXP(avatar); }
// Use this for initialization void Awake() { HCI_Project.Library.Avatar avatar = new HCI_Project.Library.Avatar(); Global.Avatar = avatar; if (Global.Player != null) { Global.Player.EventManager.OnRemoteOperation += EventManager_OnRemoteOperation; } avatar.OnHP_Changed += Avatar_OnHP_Changed; avatar.OnLevelChanged += Avatar_OnLevelChanged; anim = GetComponent <Animator>(); playerMovement = GetComponent <CompleteProject.PlayerMovement>(); attackController = GetComponentInChildren <AttackController>(); StartCoroutine(Restore()); }
private void UpdateEXP(HCI_Project.Library.Avatar avatar) { expFill.localPosition = new Vector3(0, -expFill.sizeDelta.y * (1 - avatar.EXP / (float)avatar.MaxEXP), 0); }
private void UpdateLevel(HCI_Project.Library.Avatar avatar) { levelText.text = avatar.Level.ToString(); }
private void UpdateMP(HCI_Project.Library.Avatar avatar) { mpScrollbar.size = avatar.MP / (float)avatar.MaxMP; }