void GetFortune(Notification noti) { FortuneManager.Fortune_base fb = (FortuneManager.Fortune_base)noti.data; HP += fb.Rescue; if (HP >= HPLimited) { HP = HPLimited; } AddAttack += fb.AddAttack; if (AddAttack >= 0.5) { AddAttack = 0; NotificationCenter.DefaultCenter().PostNotification(this, "PlayerFightingAddAttack"); } }
private void OnDestroy() { FortuneManager.Fortune_base fb = new FortuneManager.Fortune_base(); fb.S = transform.position; if (RT == RobotType.FlyingSlow || RT == RobotType.GroundSlow) { fb.Rescue = 10; } else { fb.AddAttack = 0.05f; } NotificationCenter.DefaultCenter().PostNotification(this, "InstantiateFortune", fb); }