using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TargetCamera : MonoBehaviour
{
public GameObject Player;
Vector3 pos;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
pos.x = Player.transform.position.x;
pos.y = Player.transform.position.y;
pos.z = Player.transform.position.z;
transform.position = new Vector3(pos.x, pos.y,pos.z);
}
}
private void HandleUserEarnedReward(object sender, Reward e)
{
int mon = PlayerPrefs.GetInt("Money");
int gold = PlayerPrefs.GetInt("Gold");
int life = PlayerPrefs.GetInt("LifeCount");
mon += 20;
gold += 1;
life -= 1;
PlayerPrefs.SetInt("Video",1);
PlayerPrefs.SetInt("Money",mon);
PlayerPrefs.SetInt("Gold",gold);
PlayerPrefs.SetInt("LifeCount",life);
}
rewardedAd = new RewardedAd(RewardedUnitId);
AdRequest adRequest = new AdRequest.Builder().Build();
rewardedAd.LoadAd(adRequest);
private int pointCount = 0;
void Update(){
if(pointCount <= 10){
pointCount++;
//создаёшь точку
}
сложен ли вообще C#?
public GameObject obj1;
public GameObject obj2;
public GameObject obj3;
public void Start(){
StartCoroutine(Spawner());
}
IEnumerator spawner(){
while(true){
yield return new WaitForSecond(2f);
int obj = Random.Range(1,3);
switch(obj){
case 1:
Instantiate(obj1, new Vector3(i * 2.0F, 0, 0), Quaternion.identity);//свои координаты лепите
break;
case 2:
Instantiate(obj2, new Vector3(i * 2.0F, 0, 0), Quaternion.identity);//свои координаты лепите
break;
case 3:
Instantiate(obj3, new Vector3(i * 2.0F, 0, 0), Quaternion.identity);//свои координаты лепите
break;
}
}