_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/RacingPanel/ToolsManager.cs

42 lines
1.1 KiB
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ToolsManager : MonoBehaviour
{
public static ToolsManager instance;
public List<snailRiderItem> tools=new List<snailRiderItem>();
// Start is called before the first frame update
void Start()
{
instance = this;
ShowTools();
RamgeTools();
}
public void RamgeTools()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD>
{
foreach (snailRiderItem tool in tools)
{
int type = Random.Range(0, 2);
float randPosX= Random.Range(-350, 300);
tool.transform.position = new Vector2(tool.transform.position.x + randPosX, tool.transform.position.y);
if (type==0)
{
tool.mode = snailRiderItem.Mode.accelerate;
}
else
{
tool.mode = snailRiderItem.Mode.slowDown;
}
}
}
public void ShowTools()//<2F><>ʾ<EFBFBD><CABE><EFBFBD>е<EFBFBD><D0B5><EFBFBD>
{
foreach (snailRiderItem tool in tools)
{
tool.gameObject.SetActive(true);
}
}
}