当前位置:网站首页>Unity slider slider development
Unity slider slider development
2022-07-25 00:38:00 【AplusX】
If , We have two scripts :Main.cs,MySlider.cs. Now hope from Main.cs call MySlider.cs Slider class in .
// SliderControl.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SliderControl : MonoBehaviour
{
public Slider mysilder;
// Start is called before the first frame update
void Start()
{
mysilder = GetComponent<Slider>();
}
// Update is called once per frame
void Update()
{
}
}
Above is the creation of a basic slider Slider
Next, call the slider parameter in the main script
public class Main: MonoBehaviour {
public Slider m_Slider;
void Start()
{
m_Slider = GameObject.Find("Slider").GetComponent<Slider>();// find Slider object
}
void Update()
{
Debug.Log(m_Slider.value);
}
}
边栏推荐
- What can testers do when there is an online bug?
- 如果实现与在线CAD图中的线段实时求交点
- Detailed explanation of alexnet of paddlepaddle paper series (with source code)
- Where is the most formal account opening for futures trading? Capital security?
- Vscode installation and configuration
- [Bert] QA, reading comprehension, information retrieval
- Wechat applet development learning 5 (custom components)
- [leetcode weekly replay] 303rd weekly 20220724
- C recursively obtains all files under the folder and binds them to the treeview control
- Does opengauss support using Sqlalchemy connections?
猜你喜欢

Daily question 1 · 1260. Two dimensional network migration · simulation

Redis6.2 SYSTEMd startup prompt redis service: Failed with result ‘protocol‘.
![[LeetCode周赛复盘] 第 303 场周赛20220724](/img/ba/0f16f1f42e4a2593ec0124f23b30d7.png)
[LeetCode周赛复盘] 第 303 场周赛20220724

What can testers do when there is an online bug?

The new version of Alibaba Seata finally solves the idempotence, suspension and empty rollback problems of TCC mode

Fast development board for Godson solid state drive startup (burning system to solid state) - partition

js && ||

Pain and happiness -nio programming
![[leetcode weekly replay] game 83 biweekly 20220723](/img/db/c264c94ca3307d4363d3cf7f5d770b.png)
[leetcode weekly replay] game 83 biweekly 20220723

UART
随机推荐
Quartus: install cyclone 10 LP device library for quartus version 17.1
Leetcode 1260. two dimensional grid migration: two solutions (k simulations / one step)
[mindspore] [xception model] script statement is suspected to be wrong
Discussion on line segment tree
Netease game Flink SQL platform practice
Exception, import package and file operation
Unity+photon self made multiplayer TPS game
asp adodb.stream对象的方法属性
C language force buckle the eleventh question to find the maximum capacity of the bucket. (two methods)
Implement a avatar looping control
torch.nn.SyncBatchNorm.convert_ sync_ Mindspore usage corresponding to batchnorm
Redis pipeline technology / partition
Promtool Check
Multi table query of SQL
SQL file import database - Nanny level tutorial
Educational codeforces round 89 (rated for Div. 2) ABC problem solution
Grafana connection tdengine reports an error 535
js && ||
Basic functions of tea
Ggplot2 visual faceting, visual faceted ridge plot with facet_wrap, and customize the background color of the faceted icon title box