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

做网站在经营范围内属于什么百度客服联系方式

做网站在经营范围内属于什么,百度客服联系方式,织梦5.7cms照明灯具能源电子产品企业网站源码企业模板带后台,wordpress更知鸟Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考 此代码仅为较上一P有所改变的代码 【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili Blackhole_Skill_Controller.cs using System.Collections; using System…

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

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

Blackhole_Skill_Controller.cs
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;public class Blackhole_Skill_Controller : MonoBehaviour
{[SerializeField] private GameObject hotKeyPrefab;[SerializeField] private List<KeyCode> KeyCodeList;private float maxSize;//最大尺寸private float growSpeed;//变大速度private float shrinkSpeed;//缩小速度private float blackholeTimer;private bool canGrow = true;//是否可以变大private bool canShrink;//缩小private bool canCreateHotKeys = true;专门控制后面进入的没法生成热键private bool cloneAttackReleased;private bool playerCanDisaper = true;private int amountOfAttacks = 4;private float cloneAttackCooldown = .3f;private float cloneAttackTimer;private List<Transform> targets = new List<Transform>();private List<GameObject> createdHotKey = new List<GameObject>();public bool playerCanExitState { get; private set; }public void SetupBlackhole(float _maxSize,float _growSpeed,float _shrinkSpeed,int _amountOfAttacks,float _cloneAttackCooldown,float _blackholeDuration){maxSize = _maxSize;growSpeed = _growSpeed;shrinkSpeed = _shrinkSpeed;amountOfAttacks = _amountOfAttacks;cloneAttackCooldown = _cloneAttackCooldown;blackholeTimer = _blackholeDuration;if (SkillManager.instance.clone.crystalInsteadOfClone)//释放水晶时角色不消失playerCanDisaper = false;}private void Update(){blackholeTimer -= Time.deltaTime;cloneAttackTimer -= Time.deltaTime;if(blackholeTimer <= 0){blackholeTimer = Mathf.Infinity;//防止重复检测if (targets.Count > 0)//只有有target才释放攻击{ReleaseCloneAttack();//释放攻击}elseFinishBlackholeAbility();//缩小黑洞}if (Input.GetKeyDown(KeyCode.R)&& targets.Count > 0){ReleaseCloneAttack();}CloneAttackLogic();if (canGrow && !canShrink){//这是控制物体大小的参数transform.localScale = Vector2.Lerp(transform.localScale, new Vector2(maxSize, maxSize), growSpeed * Time.deltaTime);//类似MoveToward,不过是放大到多少大小 https://docs.unity3d.com/cn/current/ScriptReference/Vector2.Lerp.html}if (canShrink){transform.localScale = Vector2.Lerp(transform.localScale, new Vector2(0, 0), shrinkSpeed * Time.deltaTime);if (transform.localScale.x <= 1f){Destroy(gameObject);}}}//释放技能private void ReleaseCloneAttack(){cloneAttackReleased = true;canCreateHotKeys = false;DestroyHotKeys();if(playerCanDisaper){playerCanDisaper = false;PlayerManager.instance.player.MakeTransprent(true);}}private void CloneAttackLogic(){if (cloneAttackTimer < 0 && cloneAttackReleased&&amountOfAttacks>0){cloneAttackTimer = cloneAttackCooldown;int randomIndex = Random.Range(0, targets.Count);//限制攻击次数和设置攻击偏移量float _offset;if (Random.Range(0, 100) > 50)_offset = 1.5f;else_offset = -1.5f;if (SkillManager.instance.clone.crystalInsteadOfClone){SkillManager.instance.crystal.CreateCrystal(); //让生成克隆变成生成水晶SkillManager.instance.crystal.CurrentCrystalChooseRandomTarget(); //让黑洞里替换出来的水晶能够随机选择目标}else{SkillManager.instance.clone.CreateClone(targets[randomIndex], new Vector3(_offset, 0, 0));}amountOfAttacks--;if (amountOfAttacks <= 0){Invoke("FinishBlackholeAbility", 0.5f);}}}//完成黑洞技能后private void FinishBlackholeAbility(){DestroyHotKeys();canShrink = true;cloneAttackReleased = false;playerCanExitState = true;}private void OnTriggerEnter2D(Collider2D collision){if(collision.GetComponent<Enemy>()!=null){collision.GetComponent<Enemy>().FreezeTime(true);CreateHotKey(collision);}}private void OnTriggerExit2D(Collider2D collision){if (collision.GetComponent<Enemy>() != null){collision.GetComponent<Enemy>().FreezeTime(false);}}//创建QTE函数private void CreateHotKey(Collider2D collision){if(KeyCodeList.Count == 0)//当所有的KeyCode都被去除,就不在创建实例{return;}if(!canCreateHotKeys)//这是当角色已经开大了,不在创建实例{return;}//创建实例GameObject newHotKey = Instantiate(hotKeyPrefab, collision.transform.position + new Vector3(0, 2), Quaternion.identity);//将实例添加进列表createdHotKey.Add(newHotKey);//随机KeyCode传给HotKey,并且传过去一个毁掉一个KeyCode choosenKey = KeyCodeList[Random.Range(0, KeyCodeList.Count)];KeyCodeList.Remove(choosenKey);Blackhole_Hotkey_Controller newHotKeyScript = newHotKey.GetComponent<Blackhole_Hotkey_Controller>();newHotKeyScript.SetupHotKey(choosenKey, collision.transform, this);}//添加点击hotkey后对应的敌人进入敌人列表public void AddEnemyToList(Transform _myEnemy){targets.Add(_myEnemy);}//销毁Hotkeyprivate void DestroyHotKeys(){if(createdHotKey.Count <= 0){return;}for (int i = 0; i < createdHotKey.Count; i++){Destroy(createdHotKey[i]); }}}

Blackhole_Skill.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Blackhole_Skill : Skill
{[SerializeField]private float maxSize;//最大尺寸[SerializeField] private float growSpeed;//变大速度[SerializeField] private float shrinkSpeed;//缩小速度[SerializeField] private GameObject blackholePrefab;[Space][SerializeField] private float blackholeDuration;[SerializeField] int amountOfAttacks = 4;[SerializeField] float cloneAttackCooldown = .3f;Blackhole_Skill_Controller currentBlackhole;public override bool CanUseSkill(){return base.CanUseSkill();}public override void UseSkill(){base.UseSkill();GameObject newBlackhole = Instantiate(blackholePrefab,player.transform.position,Quaternion.identity);currentBlackhole = newBlackhole.GetComponent<Blackhole_Skill_Controller>();currentBlackhole.SetupBlackhole(maxSize,growSpeed,shrinkSpeed,amountOfAttacks,cloneAttackCooldown,blackholeDuration);}protected override void Start(){base.Start();}protected override void Update(){base.Update();}public bool SkillCompleted(){if(currentBlackhole == null)return false;if (currentBlackhole.playerCanExitState){return true;}else{return false;}}//把随机敌人半径改成黑洞半径的一半就行public float GetBlackholeRadius(){return maxSize / 2;}
}

Clone_Skill.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Crystal_Skill : Skill
{[SerializeField] private GameObject crystalPrefab;[SerializeField] private float crystalDuration;using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Clone_Skill : Skill
{[Header("Clone Info")][SerializeField] private GameObject clonePrefab;//克隆原型[SerializeField] private float cloneDuration;//克隆持续时间[SerializeField] private bool canAttack;// 判断是否可以攻击[SerializeField] private bool createCloneOnDashStart;[SerializeField] private bool createCloneOnDashOver;[SerializeField] private bool canCreateCloneOnCounterAttack;[Header("Clone can duplicate")][SerializeField] private bool canDuplicateClone;[SerializeField] private float chanceToDuplicate;[Header("Crystal instead of clone")]public bool crystalInsteadOfClone;public void CreateClone(Transform _clonePosition,Vector3 _offset)//传入克隆位置{if(crystalInsteadOfClone){SkillManager.instance.crystal.CreateCrystal();return;}//让所有的生成克隆的技能都变成生成水晶GameObject newClone = Instantiate(clonePrefab);//创建新的克隆//克隆 original 对象并返回克隆对象。//https://docs.unity3d.com/cn/current/ScriptReference/Object.Instantiate.htmlnewClone.GetComponent<Clone_Skill_Controller>().SetupClone(_clonePosition,cloneDuration,canAttack,_offset,FindClosestEnemy(newClone.transform),canDuplicateClone,chanceToDuplicate);//调试clone的位置,同时调试克隆持续时间                                                                                            //Controller绑在克隆原型上的,所以用GetComponent                                                                                        }//让冲刺留下来的克隆在开始和结束各有一个public void CreateCloneOnDashStart(){if (createCloneOnDashStart)CreateClone(player.transform, Vector3.zero);}public void CreateCloneOnDashOver(){if(createCloneOnDashOver)CreateClone(player.transform, Vector3.zero);}//反击后产生一个克隆被刺敌人public void CanCreateCloneOnCounterAttack(Transform _enemyTransform){if (canCreateCloneOnCounterAttack)StartCoroutine(CreateCloneWithDelay(_enemyTransform, new Vector3(1 * player.facingDir, 0, 0)));}//整个延迟生成private IEnumerator CreateCloneWithDelay(Transform _enemyTransform, Vector3 _offset){yield return new WaitForSeconds(.4f);CreateClone(_enemyTransform, _offset);}
}private GameObject currentCrystal;[Header("Crystal mirage")][SerializeField] private bool cloneInsteadOfCrystal;[Header("Explosive crystal")][SerializeField] private bool canExplode;[Header("Moving crystal")][SerializeField] private bool canMoveToEnemy;[SerializeField] private float moveSpeed;[Header("Multi stacking crystal")][SerializeField] private bool canUseMultiStacks;[SerializeField] private int amountOfStacks;[SerializeField] private float multiStackCooldown;[SerializeField] private List<GameObject> crystalLeft = new List<GameObject>();//水晶列表[SerializeField] private float useTimeWindow;public override bool CanUseSkill(){return base.CanUseSkill();}public override void UseSkill(){base.UseSkill();if (CanUseMultiCrystal())return;if (currentCrystal == null){CreateCrystal();}else{//限制玩家在水晶可以移动时瞬移if (canMoveToEnemy)return;//爆炸前与角色交换位置Vector2 playerPos = player.transform.position;player.transform.position = currentCrystal.transform.position;currentCrystal.transform.position = playerPos;//水晶互换时在水晶处出现clone,水晶消失if (cloneInsteadOfCrystal){SkillManager.instance.clone.CreateClone(currentCrystal.transform,Vector3.zero);Destroy(currentCrystal);}else{currentCrystal.GetComponent<Crystal_Skill_Controller>()?.FinishCrystal();}       }}public void CreateCrystal(){currentCrystal = Instantiate(crystalPrefab, player.transform.position, Quaternion.identity);Crystal_Skill_Controller currentCrystalScripts = currentCrystal.GetComponent<Crystal_Skill_Controller>();currentCrystalScripts.SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(currentCrystal.transform));}public void CurrentCrystalChooseRandomTarget() => currentCrystal.GetComponent<Crystal_Skill_Controller>().ChooseRandomEnemy();protected override void Start(){base.Start();}protected override void Update(){base.Update();}private bool CanUseMultiCrystal()//将List里的东西实例化函数{if(canUseMultiStacks){if(crystalLeft.Count > 0&&cooldownTimer<0){if(crystalLeft.Count == amountOfStacks){Invoke("ResetAbility", useTimeWindow);// 设置自动补充水晶函数}cooldown = 0;GameObject crystalToSpawn = crystalLeft[crystalLeft.Count - 1];GameObject newCrystal = Instantiate(crystalToSpawn, player.transform.position, Quaternion.identity);crystalLeft.Remove(crystalToSpawn);newCrystal.GetComponent<Crystal_Skill_Controller>().SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(newCrystal.transform));//当水晶发射完设置冷却时间和使用补充水晶if (crystalLeft.Count<=0){cooldown = multiStackCooldown;RefilCrystal();}}return true;}return false;}private void RefilCrystal()//给List填充Prefab函数{int amountToAdd = amountOfStacks - crystalLeft.Count;for (int i = 0;i < amountToAdd; i++){crystalLeft.Add(crystalPrefab);}}private void ResetAbility()//自动补充水晶函数{if (cooldownTimer > 0)return;cooldown = multiStackCooldown;RefilCrystal();}
}
Crystal_Skill_Controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Crystal_Skill_Controller : MonoBehaviour
{private Animator anim => GetComponent<Animator>();private CircleCollider2D cd => GetComponent<CircleCollider2D>();private float crystalExitTimer;private bool canExplode;private bool canMove;private float moveSpeed;private bool canGrow;private float growSpeed = 5;private Transform closestTarget;[SerializeField] private LayerMask whatIsEnemy;public void SetupCrystal(float _crystalDuration,bool _canExplode,bool _canMove,float _moveSpeed,Transform _closestTarget){crystalExitTimer = _crystalDuration;canExplode = _canExplode;canMove = _canMove;moveSpeed = _moveSpeed;closestTarget = _closestTarget;}//让黑洞里替换出来的水晶能够随机选择目标public void ChooseRandomEnemy()//Ctrl里写函数,让最近敌人改成列表里的随机敌人{float radius = SkillManager.instance.blackhole.GetBlackholeRadius();//把随机敌人半径改成黑洞半径的一半就行Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, 50, whatIsEnemy);if(colliders.Length >= 0){closestTarget = colliders[Random.Range(0,colliders.Length)].transform;Debug.Log("Give Random");}}private void Update(){crystalExitTimer -= Time.deltaTime;if (crystalExitTimer < 0){FinishCrystal();}//可以运动就靠近敌人后爆炸,范围小于1时爆炸,并且爆炸时不能移动if (canMove){//修复攻击范围内没有敌人会报错的bugif(closestTarget != null){transform.position = Vector2.MoveTowards(transform.position, closestTarget.position, moveSpeed * Time.deltaTime);if (Vector2.Distance(transform.position, closestTarget.position) < 1){FinishCrystal();canMove = false;}}elsetransform.position = Vector2.MoveTowards(transform.position, transform.position+new Vector3(5,0,0), moveSpeed * Time.deltaTime);}//爆炸瞬间变大if (canGrow)transform.localScale = Vector2.Lerp(transform.localScale, new Vector2(3, 3), growSpeed * Time.deltaTime);}//爆炸造成伤害private void AnimationExplodeEvent(){Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, cd.radius);foreach(var hit in colliders){if (hit.GetComponent<Enemy>() != null)hit.GetComponent<Enemy>().Damage();}}public void FinishCrystal(){if (canExplode){canGrow = true;anim.SetBool("Explode",true);}else{SelfDestory();}}public void SelfDestory() => Destroy(gameObject);
}

Crystal_Skill
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Crystal_Skill : Skill
{[SerializeField] private GameObject crystalPrefab;[SerializeField] private float crystalDuration;private GameObject currentCrystal;[Header("Crystal mirage")][SerializeField] private bool cloneInsteadOfCrystal;[Header("Explosive crystal")][SerializeField] private bool canExplode;[Header("Moving crystal")][SerializeField] private bool canMoveToEnemy;[SerializeField] private float moveSpeed;[Header("Multi stacking crystal")][SerializeField] private bool canUseMultiStacks;[SerializeField] private int amountOfStacks;[SerializeField] private float multiStackCooldown;[SerializeField] private List<GameObject> crystalLeft = new List<GameObject>();//水晶列表[SerializeField] private float useTimeWindow;public override bool CanUseSkill(){return base.CanUseSkill();}public override void UseSkill(){base.UseSkill();if (CanUseMultiCrystal())return;if (currentCrystal == null){CreateCrystal();}else{//限制玩家在水晶可以移动时瞬移if (canMoveToEnemy)return;//爆炸前与角色交换位置Vector2 playerPos = player.transform.position;player.transform.position = currentCrystal.transform.position;currentCrystal.transform.position = playerPos;//水晶互换时在水晶处出现clone,水晶消失if (cloneInsteadOfCrystal){SkillManager.instance.clone.CreateClone(currentCrystal.transform,Vector3.zero);Destroy(currentCrystal);}else{currentCrystal.GetComponent<Crystal_Skill_Controller>()?.FinishCrystal();}       }}public void CreateCrystal(){currentCrystal = Instantiate(crystalPrefab, player.transform.position, Quaternion.identity);Crystal_Skill_Controller currentCrystalScripts = currentCrystal.GetComponent<Crystal_Skill_Controller>();currentCrystalScripts.SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(currentCrystal.transform));}public void CurrentCrystalChooseRandomTarget() => currentCrystal.GetComponent<Crystal_Skill_Controller>().ChooseRandomEnemy();protected override void Start(){base.Start();}protected override void Update(){base.Update();}private bool CanUseMultiCrystal()//将List里的东西实例化函数{if(canUseMultiStacks){if(crystalLeft.Count > 0&&cooldownTimer<0){if(crystalLeft.Count == amountOfStacks){Invoke("ResetAbility", useTimeWindow);// 设置自动补充水晶函数}cooldown = 0;GameObject crystalToSpawn = crystalLeft[crystalLeft.Count - 1];GameObject newCrystal = Instantiate(crystalToSpawn, player.transform.position, Quaternion.identity);crystalLeft.Remove(crystalToSpawn);newCrystal.GetComponent<Crystal_Skill_Controller>().SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(newCrystal.transform));//当水晶发射完设置冷却时间和使用补充水晶if (crystalLeft.Count<=0){cooldown = multiStackCooldown;RefilCrystal();}}return true;}return false;}private void RefilCrystal()//给List填充Prefab函数{int amountToAdd = amountOfStacks - crystalLeft.Count;for (int i = 0;i < amountToAdd; i++){crystalLeft.Add(crystalPrefab);}}private void ResetAbility()//自动补充水晶函数{if (cooldownTimer > 0)return;cooldown = multiStackCooldown;RefilCrystal();}
}


文章转载自:
http://galactophorous.rmyt.cn
http://alienist.rmyt.cn
http://crin.rmyt.cn
http://pneumogastric.rmyt.cn
http://enrank.rmyt.cn
http://expansion.rmyt.cn
http://voiture.rmyt.cn
http://baddy.rmyt.cn
http://modulation.rmyt.cn
http://myosis.rmyt.cn
http://futurama.rmyt.cn
http://loyally.rmyt.cn
http://armure.rmyt.cn
http://genotype.rmyt.cn
http://loadometer.rmyt.cn
http://falsifier.rmyt.cn
http://biopolymer.rmyt.cn
http://psychiater.rmyt.cn
http://norroy.rmyt.cn
http://loungewear.rmyt.cn
http://cryohydrate.rmyt.cn
http://unbearable.rmyt.cn
http://ciel.rmyt.cn
http://hubby.rmyt.cn
http://nothofagus.rmyt.cn
http://filamerican.rmyt.cn
http://fallacious.rmyt.cn
http://uncultivated.rmyt.cn
http://fossilist.rmyt.cn
http://chemotropically.rmyt.cn
http://astronaut.rmyt.cn
http://nopal.rmyt.cn
http://cathode.rmyt.cn
http://swith.rmyt.cn
http://salesroom.rmyt.cn
http://fiddlededee.rmyt.cn
http://remittent.rmyt.cn
http://parlour.rmyt.cn
http://erstwhile.rmyt.cn
http://photonasty.rmyt.cn
http://pastry.rmyt.cn
http://irreversibility.rmyt.cn
http://ballistician.rmyt.cn
http://unsupportable.rmyt.cn
http://circumoral.rmyt.cn
http://monobloc.rmyt.cn
http://cheaters.rmyt.cn
http://vahah.rmyt.cn
http://reafference.rmyt.cn
http://cippus.rmyt.cn
http://korean.rmyt.cn
http://xenoantigen.rmyt.cn
http://sightseeing.rmyt.cn
http://rusticity.rmyt.cn
http://soothingly.rmyt.cn
http://spermatozoa.rmyt.cn
http://marcel.rmyt.cn
http://ladylove.rmyt.cn
http://ceaselessly.rmyt.cn
http://sincere.rmyt.cn
http://bloodline.rmyt.cn
http://pyrosulphate.rmyt.cn
http://neurofibril.rmyt.cn
http://brute.rmyt.cn
http://offshore.rmyt.cn
http://eo.rmyt.cn
http://aswoon.rmyt.cn
http://crump.rmyt.cn
http://ocellus.rmyt.cn
http://mugwump.rmyt.cn
http://antetype.rmyt.cn
http://sheldrake.rmyt.cn
http://residual.rmyt.cn
http://swellfish.rmyt.cn
http://thallious.rmyt.cn
http://interrelate.rmyt.cn
http://denitrate.rmyt.cn
http://adipocere.rmyt.cn
http://spadebone.rmyt.cn
http://subabdominal.rmyt.cn
http://unsubsidized.rmyt.cn
http://cardiomegaly.rmyt.cn
http://oocyst.rmyt.cn
http://asocial.rmyt.cn
http://diplopia.rmyt.cn
http://stressable.rmyt.cn
http://parasail.rmyt.cn
http://enthral.rmyt.cn
http://impolitely.rmyt.cn
http://inez.rmyt.cn
http://ascaris.rmyt.cn
http://jeepers.rmyt.cn
http://nablus.rmyt.cn
http://alienor.rmyt.cn
http://masonry.rmyt.cn
http://ectrodactylous.rmyt.cn
http://cogency.rmyt.cn
http://autotomize.rmyt.cn
http://attackman.rmyt.cn
http://oysterwoman.rmyt.cn
http://www.dt0577.cn/news/58067.html

相关文章:

  • 电子商务网站建设目的和意义seo招聘信息
  • 未及时取消网站备案可以放友情链接的网站
  • 厦门网站制作建设小说关键词搜索器
  • 推荐扬中网站建设营业推广方案
  • 北京代理记账财务公司seo关键词排名
  • 网站怎么做国际化百度超级链
  • 手机端网站建设要点seo工作职位
  • 做淘宝联盟网站东莞优化疫情防控措施
  • 杭州雄飞网站建设网络公司线上推广方案怎么写
  • 网站设计用什么软件实现高级seo培训
  • 怎样制作一个网站百度联盟是什么
  • 东莞手机建网站免费发布信息平台有哪些
  • 有没有99块钱做网站中国域名网官网
  • html5响应式布局网站360优化大师下载
  • 企业服务平台官网入口百度竞价优化排名
  • 优化方案英语答案申泽seo
  • 从零开始学wordpressseo的工作流程
  • 批发网站建设站长统计在线观看
  • 男女做那个的的视频网站网络营销的一般流程
  • sns有哪些著名的网站互动营销名词解释
  • 在哪家公司建设网站好搜索引擎推广试题
  • html5做网站seo还有用吗
  • 百度seo快速排名优化软件优化设计电子版
  • 萧山做网站公司新站点seo联系方式
  • 如何投诉做网站的公司免费网络营销推广软件
  • jquery mobile 做的网站净水器十大品牌
  • 信息图表制作网站国际国内新闻最新消息今天
  • 产品营销推广方式厦门seo关键词
  • 徐州建站网页建设seo公司怎么样
  • 自己做的网站 能收索么网站推广步骤