//public CameraPan camera1; //----------------------------------------------------------------------------------------------------------------------------- // Start is called before the first frame update void Start() { /* Player Object */ player1 = GameObject.FindWithTag("PlayerTank1").GetComponent <PlayerTank1>(); player2 = GameObject.FindWithTag("PlayerTank2").GetComponent <PlayerTank2>(); /* Camera Object */ //camera1 = GameObject.FindWithTag("MainCamera").GetComponent<CameraPan>(); /* Match Timer */ displayTime = (int)matchTime; timerText.text = displayTime.ToString(); /* Player 1 Timer */ p1Time = player1.turnTime; p1DisplayTime = (int)p1Time; Player1Timer.text = p1DisplayTime.ToString(); /* Player 2 Timer */ p2Time = player2.turnTime; p2DisplayTime = (int)p2Time; Player2Timer.text = p2DisplayTime.ToString(); /* Start timer */ startTimer = startTime; //startTimerDisplay = (int)startTimer; //startTimerDis.text = startTimerDisplay.ToString(); }
public void Start() { player1 = GameObject.FindWithTag("PlayerTank1").GetComponent <PlayerTank1>(); player2 = GameObject.FindWithTag("PlayerTank2").GetComponent <PlayerTank2>(); //camera1 = GameObject.FindWithTag("MainCamera").GetComponent<CameraPan>(); tilemap = GameObject.FindWithTag("Ground").GetComponent <Tilemap>(); IsDestroyed = true; tilemap = tilemapGameObject.GetComponent <Tilemap>(); }
/* Reset Variables */ //public bool resetUse; // Need to get this uncommented one the function is working // Start is called before the first frame update void Start() { Transform bar = transform.Find("Bar"); healthAmount = 1; target = GameObject.FindWithTag("PlayerTank2").transform; opponentScript = GameObject.FindWithTag("PlayerTank2").GetComponent <PlayerTank2>(); currentHealth = startHealth; isDestroyed = false; }
/*---------------------------------------------------------------*/ void Start() { /* This is instantiating the tank objects as an accesable variable */ player1 = GameObject.FindWithTag("PlayerTank1").GetComponent <PlayerTank1>(); player2 = GameObject.FindWithTag("PlayerTank2").GetComponent <PlayerTank2>(); /* this is instantiating the bullet object as an accesable variable */ //Bullet = GameObject.FindWithTag("Bullet").GetComponent<ProjectileCollision>(); /* instantiating the match script as a variable */ match = GameObject.FindWithTag("GameController").GetComponent <MatchScript>(); /* Instatiating variables to access the postitions of the tanks */ tank1 = GameObject.FindWithTag("PlayerTank1").transform; tank2 = GameObject.FindWithTag("PlayerTank2").transform; /* setting the projectile timers */ timer1 = baseTimer; timer2 = baseTimer; } // end void start