Exemplo n.º 1
0
    //public JsonUtils jsonutils;
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        InitGame();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        myTransform = transform;

        tankBehavior = GameObject.Find("Torque").GetComponent <TankBehaviorScripts>();
        tankBehavior = GameObject.FindObjectOfType <TankBehaviorScripts>();
        _kecAwal     = tankBehavior.kecepatanAwalPeluru;
        _sudutTembak = tankBehavior.nilaiRotasiY;
        _sudutMeriam = tankBehavior.sudutMeriam;

        _posisiAwal = myTransform.position;

        audioSource = GetComponent <AudioSource>();

        _gravitasi = GameObject.FindObjectOfType <TankBehaviorScripts>().gravity;

        gameManager = GameObject.FindObjectOfType <GameManagerScripts>();
    }