当前位置:网站首页>Unity exploration plot access design analysis & process + code specific implementation
Unity exploration plot access design analysis & process + code specific implementation
2022-07-29 06:59:00 【Rice shrimp】
️ The foreword introduces :
- For example, we have the following map ( Conceptual design drawings ) Need to explore

️ Game background :
- The main castle is located in the center on the far right of the map , The monster is generated from the left .
- We dig plots to generate paths that affect strange paths , Resist the invasion of monsters by building towers .
- The road that has been dug is the movement range of the little monster , Some plots that have not been excavated can be placed with the desired tower .
- Some plots have the probability to get special rewards / Colored eggs , Different elements can be designed to interact with towers and different plots ( It's inconvenient to do specific development here , You can make up your own brain )
- Our goal is to successfully resist multiple waves of monster attacks , Successfully defend our main castle .
️ Description of specific functional modules :
- A currently explored plot will have a logo , If this is a digeable plot , We click on the logo , There will be 2~3 A small triangle arrow , Click an arrow , If the plot pointed to is a digeable plot , It will become a passage .
- What we need to design is to realize such an idea or function , And expand it into a General interface for external calls .
️ Design thinking :
- The starting point is not covered by parcels , It's a pathway , Use a small special effect picture as a logo , By clicking the arrow in any direction , You can turn the plot pointed by the arrow into a road .
- The process of this change is actually switching a picture , And hide the arrow of the previous parcel and show the arrow of the next parcel .
- Here's an important point , We Ensure that the generated path is continuous , For example, the texture of the previous one is vertical , The next one should be consistent with it , When encountering a detour , Also show the curved road , This requires two judgments , The first judgment should be consistent with the previous one , The second judgment should be consistent with the two before and after .
️ Realization effect :


️ Implementation process :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class chufa : MonoBehaviour
{
public GameObject Stick, changeStick;
public GameObject btn1, btn2;
public GameObject btn_stick1, btn_stick2;
public Image sr;
public Sprite[] pic;
void Start () {
sr = GetComponent<Image>();
Button btn = Stick.GetComponentInChildren<Button>();
btn.onClick.AddListener (OnStartButtonClick);
}
public void OnStartButtonClick()
{
Debug.Log(" Ha ha ha ha ! see , You seem to be a fool !!");
changeStick.GetComponent<Image>().sprite = pic[0];
btn_stick1.SetActiveRecursively(false);
btn_stick2.SetActiveRecursively(false);
btn1.SetActiveRecursively(true);
btn2.SetActiveRecursively(true);
}
public void TransRoad()
{
//...
}
}边栏推荐
- DBAsql面试题
- Analog volume leetcode [normal] 093. Restore IP address
- Instruction rearrangement under multithreading concurrency
- Teacher Wang Shuyao's notes on operations research 09 linear programming and simplex method (Application of simplex table)
- Junda technology | applicable to "riyueyuan" brand ups wechat cloud monitoring card
- API for using the new date class of instant
- Teacher wangshuyao wrote the notes of operations research course 00 in the front
- IO流 - File - properties
- Teacher wangshuyao's notes on operations research 06 linear programming and simplex method (geometric significance)
- Teacher wangshuyao's notes on operations research course 10 linear programming and simplex method (discussion on detection number and degradation)
猜你喜欢

Embedding understanding + code

Teacher wangshuyao's notes on operations research course 10 linear programming and simplex method (discussion on detection number and degradation)

如何优雅的写 Controller 层代码?

【冷冻电镜|论文阅读】emClarity:用于高分辨率冷冻电子断层扫描和子断层平均的软件

【冷冻电镜】Relion4.0——subtomogram教程

Actual combat! Talk about how to solve the deep paging problem of MySQL

JVM之垃圾回收机制(GC)

Why does 5g N2 interface control plane use SCTP protocol?

【讲座笔记】如何在稀烂的数据中做深度学习?

MySQL: what happens in the bufferpool when you crud? Ten pictures can make it clear
随机推荐
SSH免密登录-两台虚拟机建立免密通道 双向信任
说一下 TCP/IP 协议?以及每层的作用?
实战!聊聊如何解决MySQL深分页问题
【经验】通过跳板机远程连接内网服务器的相关配置
Let the computer run only one program setting
王树尧老师运筹学课程笔记 02 高等数学基础
量子机器学习中的安全性问题
10 frequently asked JVM questions in interviews
Teacher Wu Enda's machine learning course notes 03 review of linear algebra
游戏资产的革命
【论文阅读】TomoAlign: A novel approach to correcting sample motion and 3D CTF in CryoET
Teacher wangshuyao's notes on operations research 03 KKT theorem
Teacher wangshuyao's notes on operations research 05 linear programming and simplex method (concept, modeling, standard type)
Mutual conversion between Base64 and file
模拟卷Leetcode【普通】081. 搜索旋转排序数组 II
分享一些你代码更好的小建议,流畅编码提搞效率
吴恩达老师机器学习课程笔记 02 单变量线性回归
模拟卷Leetcode【普通】150. 逆波兰表达式求值
关于SQL Server语句入门级应用阶段性学习——找工作必备(一)
mysql查询区分大小写