当前位置:网站首页>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()
{
//...
}
}边栏推荐
- Teacher Wu Enda's machine learning course notes 00 are written in the front
- Embedding understanding + code
- 数据库使用psql及jdbc进行远程连接,不定时自动断开的解决办法
- Share some tips for better code, smooth coding and improve efficiency
- mysql可以定时导出表格吗?
- Security in quantum machine learning
- The difference between pairs and ipairs
- 模拟卷Leetcode【普通】150. 逆波兰表达式求值
- Teacher wangshuyao's operations research course notes 07 linear programming and simplex method (standard form, base, base solution, base feasible solution, feasible base)
- SS command details
猜你喜欢

Unity探索地块通路设计分析 & 流程+代码具体实现

线程 - 线程安全 - 线程优化

Joint modeling of price preference and interest preference in conversation recommendation - extensive reading of papers

CVPR2022Oral专题系列(一):低光增强

How to write controller layer code gracefully?

Ali gave several SQL messages and asked how many tree search operations need to be performed?

猜数字//第一次使用生成随机数

10道面试常问JVM题

Federal learning backdoor attack summary (2019-2022)

N2 interface of 5g control plane protocol
随机推荐
【解决方案】ERROR: lib/bridge_generated.dart:837:9: Error: The parameter ‘ptr‘ of the method ‘FlutterRustB
【CryoEM】FSC, Fourier Shell Correlation简介
【技能积累】写邮件时的常用表达
5g service interface and reference point
关于SQL Server语句入门级应用阶段性学习——找工作必备(一)
模拟卷Leetcode【普通】061. 旋转链表
10道面试常问JVM题
Salesforce中过滤器Filter使用的相对日期
Simulation volume leetcode [normal] 222. number of nodes of complete binary tree
【冷冻电镜】Relion4.0——subtomogram教程
Neuralcf neural collaborative filtering network
Shallow reading of shared lock source code of abstractqueuedsynchronizer (AQS)
Simulation volume leetcode [normal] 061. rotating linked list
Teacher Wang Shuyao's notes on operations research 09 linear programming and simplex method (Application of simplex table)
MySQL:当你CRUD时BufferPool中发生了什么?十张图就能说清楚
Simulation volume leetcode [ordinary] 172. Zero after factorial
模拟卷Leetcode【普通】093. 复原 IP 地址
王树尧老师运筹学课程笔记 00 写在前面
Basic knowledge of MySQL (high frequency interview questions)
【冷冻电镜|论文阅读】子断层平均 M 软件解读:Multi-particle cryo-EM refinement with M