void Start() { hat = GameObject.Find("Hat"); GameObject cube = GameObject.Find("Cube"); cubescript = (cubeScript)cube.GetComponent(typeof(cubeScript)); }
// removes the player droid void removeDroid() { // update the objCube so it will know what time the player is being removed at cubeScript ptrcubeScript = (cubeScript)objCube.GetComponent(typeof(cubeScript)); ptrcubeScript.timePlayerRemovedAt = Time.time; Destroy(gameObject); }
// Use this for initialization void Start() { //Actually linking the variable 'holderScript' to the real script holderScript = staticHolder.GetComponent <staticHolderScript> (); //Getting the cube to show up in the scene cube = (GameObject)Instantiate(cubePrefab, new Vector3(0, 0, 0), Quaternion.identity); //Getting access to the functions inside the cubeScript.cs class cubeScript = cube.GetComponent <cubeScript> (); }
// Use this for initialization void Start() { //Getting the plane (which i'm using as a background) to show up in the scene planeObject = (GameObject)Instantiate(planePrefab, new Vector3(0, 0, 0), Quaternion.identity); //Changing its colour planeObject.GetComponent <Renderer>().material.color = Color.red; //Getting the cube to show up in the scene cube = (GameObject)Instantiate(cubePrefab, new Vector3(0, 0, 0), Quaternion.identity); //Actually linking the variable 'holderScript' to the real script holderScript = staticHolder.GetComponent <staticHolderScript> (); //Getting access to the functions inside the cubeScript.cs class cubeScript = cube.GetComponent <cubeScript> (); }
// **** end of variable declarations // Use this for initialization void Start() { // initialize the objPlayer variable objPlayer = gameObject; // create the initial opponent objOpponentOnStage = (GameObject)Instantiate(preFabOpponent, new Vector3(0, 0, 0), Quaternion.LookRotation(new Vector3(((float)Random.Range(1, 3)), 0, 0))); objOpponentOnStage.tag = "Opponent01"; // initialize cube variable & get the maxOpponents from it objCube = (GameObject)GameObject.FindWithTag("cube"); cubeScript ptrcubeScript = (cubeScript)objCube.GetComponent(typeof(cubeScript)); maxOpponents = ptrcubeScript.maxOpponents; // initialize camera variables objCamera = (GameObject)GameObject.FindWithTag("MainCamera"); // Initialize control state ResetControlState(); }
private void OnEnable() { scriptTarget = (cubeScript)target; }
//Fonction utilisé avant le chargement du jeu void Awake() { script = GameObject.Find("dice").GetComponent <cubeScript>(); }