Синтаксис:
Используется csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TierManager : MonoBehaviour
{
public float tier;
public float watergun_tier;
public float puddle_tier;
public float water;
public float water_target;
public float whirlpool_tier;
public GameObject tier1;
// Start is called before the first frame update
void Start()
{
water_target = 15;
}
// Update is called once per frame
void Update()
{
// волны
if (water == water_target)
{
tier++;
if (tier == 0)
{
tier1.SetActive(true);
water_target = 40;
}
}
}
public void Add_Tier(string what, int up_num)
{
if (up_num == 1)
{
tier1.SetActive(false);
}
// -----------------------
if (what == "watergun")
{
watergun_tier++;
}
if (what == "puddle")
{
puddle_tier++;
}
if (what == "whirlpool")
{
whirlpool_tier++;
}
}
}
using System.Collections.Generic;
using UnityEngine;
public class TierManager : MonoBehaviour
{
public float tier;
public float watergun_tier;
public float puddle_tier;
public float water;
public float water_target;
public float whirlpool_tier;
public GameObject tier1;
// Start is called before the first frame update
void Start()
{
water_target = 15;
}
// Update is called once per frame
void Update()
{
// волны
if (water == water_target)
{
tier++;
if (tier == 0)
{
tier1.SetActive(true);
water_target = 40;
}
}
}
public void Add_Tier(string what, int up_num)
{
if (up_num == 1)
{
tier1.SetActive(false);
}
// -----------------------
if (what == "watergun")
{
watergun_tier++;
}
if (what == "puddle")
{
puddle_tier++;
}
if (what == "whirlpool")
{
whirlpool_tier++;
}
}
}
Но функция Add_Tier() никак не хочет показываться в кнопке: