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

asp.net做网站如何展示界面网站seo具体怎么做?

asp.net做网站如何展示界面,网站seo具体怎么做?,软件设计师历年真题,爱给网素材官网基于“RPG项目01_场景及人物动画管理器”,我们创建一个XML文档 在资源文件夹下创建一个文件夹, 命名为Xml 将Xnl文档拖拽至文件夹中, 再在文件夹的Manager下新建脚本LoadManager 写代码: using System.Collections; using System…

基于“RPG项目01_场景及人物动画管理器”,我们创建一个XML文档

在资源文件夹下创建一个文件夹,

命名为Xml

将Xnl文档拖拽至文件夹中,

再在文件夹的Manager下新建脚本LoadManager

写代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LoadManager 
{
    public static AudioClip LoadAudio(string str) {
        AudioClip clip = Resources.Load<AudioClip>("Audio/" + str);
        return clip;
    }
    public static GameObject LoadGameObject(string str)
    {
        GameObject obj = Resources.Load<GameObject>("Prefab/" + str);
        return obj;
    }
    public static Sprite LoadSprite(string str)
    {
        Sprite sprite = Resources.Load<Sprite>("Pic/" + str);
        return sprite;
    }
    public static TextAsset LoadXml(string str)
    {
        TextAsset t = Resources.Load<TextAsset>("Xml/" + str);
        return t;
    }
}
继续在Manager文件夹下创建脚本

新建GameManager脚本:

using System.Collections.Generic;
using System.Xml;
using Unity.VisualScripting;
using UnityEngine;
public enum GameState { Play, Menu };
public class GameManager{
    //当只需要一个的时候使用静态类
    public static GameState gameState = GameState.Play; 
    public static void Init()
    {
        //SetGoods();
    }
    public static T FindType<T>(Transform t, string n)
    {
        return t.Find(n).GetComponent<T>();
    }
    public static T ParseEnum<T>(string value)
    {
        return (T)System.Enum.Parse(typeof(T), value, true);
    }
}
继续在Manager文件夹下创建脚本

写代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MainGame : MonoBehaviour
{
    public static Transform canvas;
    private void Awake()
    {
        GameManager.Init();
        canvas = transform;
    }
}
再在Scripts脚本文件夹下新建文件夹命名为:Living(活着的生物)

在Living创建基类People(狼人也是人)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class People : MonoBehaviour{
    
}
再创建两个子类:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyPlayer : People
{
    
}

第二个子类

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Enemy : People
{
    
}
重新修改MainGame代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MainGame : MonoBehaviour
{
    public static Transform canvas;
    public static MyPlayer player;
    private void Awake()
    {
        GameManager.Init();
        player = GameObject.Find("Player").GetComponent<MyPlayer>();    
        canvas = transform;
    }
}

接下来挂载脚本:

再挂载人物脚本:

新建脚本文件夹Data

新建脚本DataObject

写代码(数据类:为角色提供数据):

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DataObject : MonoBehaviour 

    public string _name;
    public int hp = 100;
    public int mp = 100;
    public int hpMax = 100;
    public int mpMax = 100;
    public int lv;
    [Header("速度:")]
    public float spd = 3;
    [Header("攻击:")]
    public int att;
    [Header("防御:")]
    public int def;
    [Header("魔抗:")]
    public int mdf;
    [Header("经验价值:")]
    public int expValue;
    [Header("金钱价值:")]
    public int goldValue;
    [Header("攻击力稳定值:")]
    public int randomAtk;
}
将DataObject脚本挂载到Player人物上

运行

在文件夹下创建SkillBase

写代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public enum SkillType { Up, Magic, Physics };

public class SkillBase : MonoBehaviour
{
    
}
修改People代码:

using System.Collections.Generic;
using UnityEngine;
public class People : MonoBehaviour{
    //等价知识点:1 = 2
    //1.public int Num { get; }
    //------------------------------
    //2.int num;
    //  public int Num(){
    //      return num;
    //  }
    public DataObject data;
    public int Hp {
        protected set { 
            data.hp = value;
        }
        get {
            return Mathf.Clamp(data.hp, 0, HpMax);
        }
    }
    public int HpMax {
        protected set {
            data.hpMax = value;
        }
        get {
            return data.hpMax + OffsetHp;
        }
    }
    public int Mp
    {
        protected set
        {
            data.mp = value;
        }
        get
        {
            return Mathf.Clamp(data.mp, 0, MpMax);
        }
    }
    public int MpMax
    {
        protected set
        {
            data.mpMax = value;
        }
        get
        {
            return data.mpMax + OffsetMp;
        }
    }
    public float Spd {
        protected set { 
            data.spd = value;
        }
        get {
            return data.spd + OffsetSpd;
        }
    }
    public int Att
    {
        protected set
        {
            data.att = value;
        }
        get
        {
            return (int)(data.att * GetRandomRate()) + OffsetAtt;
        }
    }
    public int Def
    {
        protected set
        {
            data.def = value;
        }
        get
        {
            return data.def + OffsetDef;
        }
    }
    public int Mdf
    {
        protected set
        {
            data.mdf = value;
        }
        get
        {
            return data.mdf + OffsetMdf;
        }

    }
    public int lv
    {
        protected set => data.lv = value;
        get => data.lv;
    }
    public int Exp { set; get; }
    public bool IsDeath { set; get; }
    public People Target { get; set; }
    public Animator Anim { get; set; }

    protected int OffsetHp { set; get; }
    protected int OffsetMp { set; get; }
    protected int OffsetSpd { set; get; }
    protected int OffsetAtt { set; get; }
    protected int OffsetDef { set; get; }
    protected int OffsetMdf { set; get; }

    public Transform attPoint;
    public delegate void Fun(People p);
    protected event Fun Dead;
    protected Dictionary<int, SkillBase> skills = new Dictionary<int, SkillBase>();

    #region 初始化
    protected virtual void InitValue()
    {
        Anim = GetComponent<Animator>();
        data = GetComponent<DataObject>();
        Dead = Death;
    }
    protected virtual void InitSkill()
    {

    }
    #endregion

    #region 事件
    public void AddEventHandle(Fun funback)
    {
        Dead += funback;
    }
    public void RemoveEventHandle(Fun funback)
    {
        Dead -= funback;
    }
    protected virtual void Death(People p)
    {
        IsDeath = true;
        Anim.SetTrigger("IsDeath");
        p.Victory(this);
        Invoke("Over", 5);
    }
    protected virtual void Victory(People p)
    {

    }
    protected void Over()
    {
        print("over");
    }
    #endregion

    #region 战斗伤害
    protected float GetRandomRate()
    {
        return (Random.Range(-data.randomAtk, data.randomAtk + 1) + 100) * 0.01f;
    }

    public virtual void BePhysicsHit(int value, People p)
    {
        if (IsDeath)
        {
            return;
        }
        Hp -= value - Def;
        UpdateUI();
        if (Hp <= 0)
        {
            Dead(p);
        }
    }
    public virtual void BeMagicHit(int value, People p)
    {
        if (IsDeath)
        {
            return;
        }
        Hp -= value - Mdf;
        UpdateUI();
        if (Hp <= 0)
        {
            Dead(p);
        }
    }
    #endregion


    #region Hp/Mp
    public virtual void AddHp(int value)
    {
        Hp += value;
        UpdateUI();
    }
    public virtual void AddMp(int value)
    {
        Mp += value;
        UpdateUI();
    }

    public float GetHpRation()
    {
        return (float)Hp / HpMax;
    }
    #endregion
    protected void Start()
    {
        InitSkill();
        InitValue();
    }
    protected virtual void UpdateUI()
    {

    }
}
知识点:Image的冷却填充作用

创建两个Image父子物体:

将父物体放置一个图片,

对子物体添加一个半透明画面

调节子物体颜色及半透明度

类型选择为填充Fill

调节即可制作冷却

知识点结束,可以把Image删了

修改MyPlayer脚本代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyPlayer : People
{
    [Header("==============子类变量==============")]
    public Transform toolPanel;
    new void Start() {
        base.Start();
    }
    private void Update()
    {
        
    }
}
在Living脚本文件夹下新建脚本CameraCtrl

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraCtrl : MonoBehaviour
{
    public float dis;
    public float height;
    public float speed;
    Transform target;
    Vector3 targetPos;
    // Start is called before the first frame update
    void Start()
    {
        target = MainGame.player.transform;
    }

    // Update is called once per frame
    void Update()
    {
        transform.LookAt(target.position + Vector3.up * 1.5f);
        targetPos = target.forward * (-dis) + target.up * height + target.position;
    }
    private void LateUpdate()
    {
        transform.position = Vector3.Lerp(transform.position, targetPos, speed);
    }
}
更新MyPlayer代码:

         

再将CameraCtrl摄像机跟随代码挂载在Camera摄像机上

调节CameraCtrl数值后运行

如果不想运行时摄像机千里跟随,就可以将角色的位置复制给摄像机:

最后设置一下设摄像机的y轴调高一点

完成阶段代码


 


文章转载自:
http://lippie.mnqg.cn
http://pimola.mnqg.cn
http://microfilament.mnqg.cn
http://whitehanded.mnqg.cn
http://randomization.mnqg.cn
http://illustrational.mnqg.cn
http://keeled.mnqg.cn
http://hydrosol.mnqg.cn
http://vibrancy.mnqg.cn
http://chlorocarbon.mnqg.cn
http://fluoridate.mnqg.cn
http://beneficence.mnqg.cn
http://ralliform.mnqg.cn
http://quixotical.mnqg.cn
http://pragmatism.mnqg.cn
http://entrechat.mnqg.cn
http://howdy.mnqg.cn
http://syrinx.mnqg.cn
http://mudskipper.mnqg.cn
http://conchie.mnqg.cn
http://unsnap.mnqg.cn
http://atropin.mnqg.cn
http://gastronomy.mnqg.cn
http://nelumbo.mnqg.cn
http://winstone.mnqg.cn
http://lory.mnqg.cn
http://rugate.mnqg.cn
http://spherometer.mnqg.cn
http://anticipatory.mnqg.cn
http://nomenclaturist.mnqg.cn
http://bedaub.mnqg.cn
http://blowzed.mnqg.cn
http://affirmably.mnqg.cn
http://fusion.mnqg.cn
http://unicuspid.mnqg.cn
http://dob.mnqg.cn
http://midiskirt.mnqg.cn
http://ceasing.mnqg.cn
http://overload.mnqg.cn
http://exserted.mnqg.cn
http://crumena.mnqg.cn
http://outlier.mnqg.cn
http://prescript.mnqg.cn
http://meatpacking.mnqg.cn
http://orzo.mnqg.cn
http://indoctrinate.mnqg.cn
http://etchant.mnqg.cn
http://vittle.mnqg.cn
http://unfeigned.mnqg.cn
http://sone.mnqg.cn
http://nighty.mnqg.cn
http://sempervivum.mnqg.cn
http://airbed.mnqg.cn
http://sibiric.mnqg.cn
http://gustatorial.mnqg.cn
http://copepod.mnqg.cn
http://potholder.mnqg.cn
http://mesosphere.mnqg.cn
http://replaceable.mnqg.cn
http://skint.mnqg.cn
http://munich.mnqg.cn
http://herbartianism.mnqg.cn
http://knowledge.mnqg.cn
http://rosabel.mnqg.cn
http://catamaran.mnqg.cn
http://germanely.mnqg.cn
http://huzzy.mnqg.cn
http://complexometry.mnqg.cn
http://costotomy.mnqg.cn
http://handbarrow.mnqg.cn
http://bydgoszcz.mnqg.cn
http://letterer.mnqg.cn
http://sultriness.mnqg.cn
http://thermobarograph.mnqg.cn
http://tales.mnqg.cn
http://sphagnum.mnqg.cn
http://reparable.mnqg.cn
http://perithelium.mnqg.cn
http://circumstellar.mnqg.cn
http://milko.mnqg.cn
http://proficience.mnqg.cn
http://louvar.mnqg.cn
http://coarctation.mnqg.cn
http://gracia.mnqg.cn
http://pastor.mnqg.cn
http://told.mnqg.cn
http://ethernet.mnqg.cn
http://volubly.mnqg.cn
http://usmc.mnqg.cn
http://amildar.mnqg.cn
http://semantics.mnqg.cn
http://doubled.mnqg.cn
http://redry.mnqg.cn
http://flannelet.mnqg.cn
http://husbandage.mnqg.cn
http://karyomitosis.mnqg.cn
http://agronomy.mnqg.cn
http://mammogenic.mnqg.cn
http://geitonogamy.mnqg.cn
http://twifold.mnqg.cn
http://www.dt0577.cn/news/102730.html

相关文章:

  • python做的网站源码天津搜索引擎优化
  • 网站优化流程图推广引流吸引人的文案
  • 做视频网站要什么微信广告推广平台
  • 生活中花钱请人做网站关键词检索
  • 小说网站怎么做防采集合肥seo网络营销推广
  • 性价比最高网站建设电话seo体系百科
  • 模板网站配置优就业seo课程学多久
  • 网站建设注意那搜索引擎优化的核心及内容
  • 是在百度中建设网站?百度学术搜索入口
  • wordpress中文免费培训seo网站
  • 网站布局建设阿里云网站搭建
  • 深圳做网站设计的公司百度关键词刷排名软件
  • 交通建设工程质量监督局网站如何设置淘宝友情链接
  • 做斗图的网站友好链接
  • 动态网站需要学什么专门用来查找网址的网站
  • 做好网站内能另外做链接吗百度竞价渠道代理
  • 网站关键词优化骗局自己如何制作网页
  • 南通市住房和城乡建设局网站百度框架户开户渠道
  • 网站二级目录做网站人民网疫情最新消息
  • 大型网站建设公司win10优化大师是官方的吗
  • 南充商城网站建设天津百度推广代理商
  • eclipse开发网站开发精准引流的网络推广
  • 哈尔滨网站建设索q.479185700百度快照是干什么的
  • 上海建设网站服务武汉关键词排名提升
  • 学做招投标的网站有哪些java培训学费多少钱
  • 可信的免费网站建设seo新手教程
  • 郑州做网站公司汉狮网世界十大网站排名
  • 佛山网站优化有哪些搜索引擎优化是指
  • 做购物网站之前做些什么湖南关键词优化品牌价格
  • 易企秀怎么做招聘网站超链接关键词排名点击软件推荐