当前位置: 首页 > news >正文

做花型设计哪个网站下载素材好视频推广渠道有哪些

做花型设计哪个网站下载素材好,视频推广渠道有哪些,绣花图案设计网站,网站开发 报价单 表格Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考 此代码仅为较上一P有所改变的代码 【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili ItemObject_Trigger.cs using System.Collections; using System.Collecti…

Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考
此代码仅为较上一P有所改变的代码

【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili

 ItemObject_Trigger.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class ItemObject_Trigger : MonoBehaviour
{private ItemObject myItemObject => GetComponentInParent<ItemObject>();private void OnTriggerEnter2D(Collider2D collision){if (collision.GetComponent<Player>() != null){myItemObject.PickupItem();}}
}

ItemObject.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class ItemObject : MonoBehaviour
{private SpriteRenderer sr;[SerializeField] private Rigidbody2D rb;//设置速度[SerializeField] private ItemData ItemData;[SerializeField] private Vector2 velocity;//设置速度private void SetupVisuals(){if (ItemData == null)return;GetComponent<SpriteRenderer>().sprite = ItemData.icon;gameObject.name = ItemData.name;}public void SetupItem(ItemData _itemData,Vector2 _velocity)设置实例函数{ItemData = _itemData;rb.velocity = _velocity;//设置速度SetupVisuals();}public void PickupItem()//拾取函数打包{Inventory.instance.AddItem(ItemData);Destroy(gameObject);}
}
ItemDrop.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;public class ItemDrop : MonoBehaviour
{[SerializeField] private int possibleItemDrop;//设置可能会出现的材料数量[SerializeField] private ItemData[] possibleDrop;private List<ItemData> dropList = new List<ItemData>();[SerializeField] private GameObject dropPrefab;[SerializeField] private ItemData item;public void GenerateDrop()//随机生成物品函数{for(int i = 0;i<possibleDrop.Length;i++)//一个判断可能出现的装备{if(Random.Range(0,100) <= possibleDrop[i].dropChance){dropList.Add(possibleDrop[i]);}       }for (int i = 0; i < possibleItemDrop; i++)//另一个生成可能出现的装备{ItemData randomItem = dropList[Random.Range(0, dropList.Count - 1)];if(possibleItemDrop <= dropList.Count ){dropList.Remove(randomItem);}DropItem(randomItem);}}public void DropItem(ItemData _itemData)//创建实例函数{GameObject newDrop = Instantiate(dropPrefab, transform.position,Quaternion.identity);Vector2 randomVelocity = new Vector2(Random.Range(-5, 5), Random.Range(15, 20));newDrop.GetComponent<ItemObject>().SetupItem(_itemData, randomVelocity);}
}
 EnemyStats.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.WSA;public class EnemyStat : CharacterStats
{private Enemy enemy;private ItemDrop myDropSystem;[Header("Level details")][SerializeField] private int leval = 1;[Range(0f, 1f)]//一个使数值设置成为一定范围的设置[SerializeField] private float percantageModifier = .4f;//设置等级和成长比例public override void DoDamage(CharacterStats _targetStats){base.DoDamage(_targetStats);}protected override void Die(){base.Die();enemy.Die();myDropSystem.GenerateDrop();}protected override void Start(){//改变伤害和生命值//解决初始血量在升级后不满ApplyLevelModifier();enemy = GetComponent<Enemy>();base.Start();myDropSystem = GetComponent<ItemDrop>();}private void ApplyLevelModifier(){Modify(strength);Modify(agility);Modify(intelligence);Modify(vitality);Modify(damage);Modify(critChance);Modify(critPower);Modify(maxHealth);Modify(armor);Modify(evasion);Modify(magicResistance);Modify(fireDamage);Modify(iceDamage);Modify(lightingDamage);}//专门对某个数值进行提升的函数private void Modify(Stat _stat){for(int i =1;i<leval;i++){float modifier = _stat.GetValue() * percantageModifier;_stat.AddModifier(Mathf.RoundToInt(modifier));}}public override void TakeDamage(int _damage){base.TakeDamage(_damage);}
}
ItemData.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public enum ItemType
{Material,Equipment
}[CreateAssetMenu(fileName = "New Item Data", menuName = "Data/Item")]
public class ItemData : ScriptableObject 
{public ItemType itemType;public string itemName;public Sprite icon;//图标[Range(0,100)]public float dropChance;
}

http://www.15wanjia.com/news/42330.html

相关文章:

  • wordpress 主题稳定百度seo公司
  • 新广告法 做网站的最新的新闻 今天
  • 个人网站网站建设方案书网络营销做得比较成功的案例
  • 政府网站建设网页设计规范做seo需要投入的成本
  • 商丘做网站张营销策划方案公司
  • 百度抓取网站登录济南网站优化排名
  • 如何用模板做网站视频外贸推广优化公司
  • 网络培训心得体会1000字如何做好搜索引擎优化工作
  • 电子商务网站建设与原理qq引流推广软件哪个好
  • 新手学建设网站书籍合肥百度快速排名提升
  • 南充网站制作p2p万能搜索引擎
  • 石家庄网站建设成功案例百度seo新站优化
  • 广汉网站建设交换免费连接
  • 做私服网站总是被攻击网站快速排名优化报价
  • 深圳网站公司建设广东最新疫情
  • 安顺网站开发优化 seo
  • 程序员除了做软件是不是就做网站百度快照优化公司
  • 外贸商城网站制作广州谷歌seo
  • wordpress 分类存档谷歌关键词排名优化
  • 灵溪网站建设如何做推广推广技巧
  • 成都代理记账聊城网站seo
  • 开通企业网站需要多少钱深圳全网营销推广平台
  • 企业网站制作设计seo基础优化包括哪些内容
  • wordpress数据库优化2018百度seo报价
  • 做电影下载网站需要什么百度网盘电脑网页版
  • 湖南郴州新网太原seo服务
  • wordpress商城模板源码上海网站搜索排名优化哪家好
  • 天津城市建设管理职业学院网站东莞seo推广
  • 网站内做链接今天的最新新闻内容
  • tech域名可以做网站吗网站seo外包价格