void Start() { //AudioSourceコンポーネントを取得し、変数に格納 sound01 = GetComponent<AudioSource>(); GameObject gameControllerObj = GameObject.FindWithTag("GameController"); gameControllerScript = (gameController)gameControllerObj.GetComponent("gameController"); }
void Start () { GameObject gameControllerObject = GameObject.FindWithTag ("GameController"); if (gameControllerObject != null) { GC = gameControllerObject.GetComponent <gameController>(); } }
// Use this for initialization void Start() { GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController"); if (gameControllerObject != null) { gameController = gameControllerObject.GetComponent <gameController>(); } }
void Start() { localCamera = GetComponent<Camera>(); controller = gameController.instance; if(localCamera.rect.position.y == 0f) { resizeTo.position = new Vector2(0.5f, resizeTo.position.y); } }
private void Start() { GameObject GameControllerObject = GameObject.FindWithTag("GameController"); if (GameControllerObject != null) { gamecontroller = GameControllerObject.GetComponent <gameController>(); } }
// Use this for initialization void Start () { GameObject gCHolder = GameObject.FindGameObjectWithTag("GameController"); if (gCHolder != null) gameCont = gCHolder.GetComponent<gameController> () as gameController; GameObject camera = GameObject.FindGameObjectWithTag("MainCamera"); camControl = camera.GetComponent<cameraController> () as cameraController; chatterBox = GameObject.FindGameObjectWithTag ("chatterBox").GetComponent<chatter> (); GameObject player = GameObject.FindGameObjectWithTag ("Player"); objectHealth = player.GetComponent <objectHealth> (); }
void Start() { _rigidBody = GetComponent <Rigidbody2D>(); _gameController = FindObjectOfType(typeof(gameController)) as gameController; // Velocity utiliza física, então não é necessário utilizar Time.DeltaTime() Vector2 movement = new Vector2(_gameController.objectSpeed, 0); _rigidBody.velocity = movement; }
// Start is called before the first frame update void Start() { _GameController = FindObjectOfType(typeof(gameController)) as gameController; _GameController._PlayerController = this; _GameController.isAlive = true; rbPlayer = GetComponent <Rigidbody2D>(); srPlayer = GetComponent <SpriteRenderer>(); }
// Update is called once per frame void Update() { x = x + xx * Time.deltaTime; y = y + yy * Time.deltaTime; ball = new Vector2(x, y); Launch(); gc = GameObject.Find("gameController"); g = gc.GetComponent <gameController>(); }
void Start() { //init gameCtrl_obj = gameController.thisgameObj; gameCtrl = gameCtrl_obj.GetComponent <gameController>(); thisImg = GetComponent <Image>(); currentColor = thisImg.color; }
// Update is called once per frame void Update() { if (gameCont == null) { gameCont = FindObjectOfType <gameController>(); } playerID = currentPlayerController.GetPlayerPrefix(); //I (Nikhil) moved this here so it would be a class variable checkAttack(); checkDeath(); }
void OnEnable() { upgradeManager = GameObject.FindGameObjectWithTag("UpgradeManager").GetComponent <upgradeManager>(); rb = GetComponent <Rigidbody2D>(); player = GameObject.FindGameObjectWithTag("Player").transform; gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <gameController>(); render = GetComponent <SpriteRenderer>(); enemySprite = render.sprite; maxScale = transform.localScale; isDead = false; }
// Use this for initialization void Start() { controller = FindObjectOfType(typeof(gameController)) as gameController; for (int i = 0; i < maxSpawnTubes; i++) { GameObject temp = Instantiate(tubePrefab) as GameObject; temp.SetActive(false); tubes.Add(temp); } currentRateSpawn = rateSpawn; }
private void Update() { if (Input.GetKey(KeyCode.Return)) { go.GetComponent <gameController>().name = txt.text; gameController gcc = go.GetComponent <gameController>(); gcc.name = txt.text; gcc.inputeado = true; this.gameObject.SetActive(false); } }
// Use this for initialization void Start() { //target = new Vector3 (970, 435, 1272);//to be dicided minFetchTime = 0.5f; deltaFetchTime = 0; rotationSpeed = 1000f; GameObject obj = GameObject.Find("gameController"); gameInfo = obj.GetComponent <gameController> (); }
void initializeInstance() { if (Instance != null) { Destroy(this.gameObject); return; } Instance = this; GameObject.DontDestroyOnLoad(this.gameObject); }
void Awake() { if (instance == null) { instance = this; } if (GamePreferences.getSave() == "" || GamePreferences.getSave() == null) { GamePreferences.save("0"); } }
// Use this for initialization void Start() { canDecrementVigor = true; canIncrementVigor = true; keyCouroutine = false; rbPlayer = GetComponent <Rigidbody2D>(); animPlayer = GetComponent <Animator>(); srPlayer = GetComponent <SpriteRenderer>(); turnedPlayer = false; _GC = FindObjectOfType(typeof(gameController)) as gameController; }
// Use this for initialization void Start() { _GC = FindObjectOfType(typeof(gameController)) as gameController; rbPlayer = GetComponent <Rigidbody2D> (); animPlayer = GetComponent <Animator> (); rbPlayer.gravityScale = gravityDefault; //srPlayer = GetComponent<SpriteRenderer> (); }
// Use this for initialization void Start() { if (instance == null) { instance = GetComponent <gameController>(); } else { Destroy(gameObject); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); gameController myScript = (gameController)target; if (GUILayout.Button("Rename Patrol Nodes")) { myScript.RenamePatrolNodes(); } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
// Use this for initialization void Start() { planeGC = GameObject.Find("plane").GetComponent <gameController>(); plane = GameObject.Find("plane"); transform.position = plane.transform.position; transform.rotation = plane.transform.rotation; rb = GetComponent <Rigidbody2D>(); rb.AddForce(transform.up * 5f, ForceMode2D.Impulse); //Debug.Log(transform.forward); Destroy(this.gameObject, .5f); planeGC.PLAYER_DATA.bulletsFired++; }
void Awake() { currentScene = SceneManager.GetActiveScene().buildIndex; if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Awake() { if (gameCont == null) { DontDestroyOnLoad(gameObject); gameCont = this; } else if (gameCont != this) { Destroy(gameObject); } }
} // Hardcoded Load Dev Settings key; Only enabled when DevMode is active public gameControls(bool useStandard) { gameController gamecontroller = new gameController(); initAllControls(); // Only call readControlsXML if the values of it should be used if (!useStandard) { gamecontroller.readControlsXML(); } }
private void Awake() { if (singleton == null) { singleton = this; } else { Destroy(this); } DontDestroyOnLoad(this.gameObject); }
void Start() { lastMonth = 1; lastYear = 1; gameControllerObject = GameObject.FindWithTag("GameController").GetComponent <gameController> (); //sr.color //create graphs here CreateGraphs(); }
// Use this for initialization void Awake() { if (control == null) { DontDestroyOnLoad(gameObject); control = this; } else if (control != this) { Destroy(gameObject); } }
// Makes sure there is always a gameController. void GameControllerRules() { if (controller == null) { DontDestroyOnLoad(gameObject); controller = this; } else if (controller != this) { Destroy(gameObject); } }
// Use this for initialization void Start() { if (control == null) { DontDestroyOnLoad(gameObject); control = this; setDefaulValue(); } else { Destroy(gameObject); } }
void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); if (gameControllerObject != null) { scoreControll = gameControllerObject.GetComponent <gameController>(); } if (scoreControll == null) { Debug.Log("Cannot find 'GameController' script"); } }
void initializeVars() { _player = player.Instance; _gameController = gameController.Instance; waypoint = _gameController.getWaypoint(); maxTimeToNewWp = timeToNewWp; maxPatrolTime = patrolTime; maxDormantTime = dormantTime; maxFindingTime = findingTime; patrolling = true; }
void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); if (gameControllerObject != null) { Control11 = gameControllerObject.GetComponent <gameController>(); } if (gameControllerObject == null) { Debug.Log("Can't Find 'GameControl' Script"); } }
// Use this for initialization void Start() { //print("Orb on Start"); audio = GetComponent<AudioSource>(); gc = (gameController) GameObject.Find("Main Camera").GetComponent("gameController"); blownUp = false; renderer = GetComponent<Renderer>(); int j = Random.RandomRange(0, colorChoice.Length); renderer.material.color = colorChoice[j]; isBomb = false; orbRB = GetComponent<Rigidbody2D>(); orbRB.velocity = new Vector2(Random.Range(-speed,speed), Random.Range(-speed,speed)); scaleVector = new Vector3(this.gameObject.transform.localScale.x * scale, this.gameObject.transform.localScale.y * scale, 0); }
void Start () { GameObject gameControllerObject = GameObject.FindWithTag ("GameController"); if (gameControllerObject != null) { gameController = gameControllerObject.GetComponent<gameController>(); } if (gameController == null) { Debug.Log ("Cannot find GameControllerScript"); } }
// Use this for initialization void Start() { controller = FindObjectOfType(typeof(gameController)) as gameController; }
// Use this for initialization void Start() { isCutSceneFinish = false; mycinematicText = GameObject.Find("cinematic text").GetComponent<cinematicText>(); isSkip = new bool[2]; canMove = new bool[2]; for (int i = 0; i < isSkip.Length; i++) { canMove[i] = false; isSkip[i] = false; } myGC = GameObject.Find("gameManager").GetComponent<gameController>(); myfadeImage = GameObject.Find("fade image").GetComponent<RawImage>(); myalpha = 1; myfadeImage.color = new Color(0, 0, 0, myalpha); myEnemy = GameObject.FindWithTag("Enemy").gameObject; myplayer = GameObject.FindWithTag("Main Player").gameObject; gameUI = GameObject.FindGameObjectsWithTag("gameUI"); foreach(GameObject temp in gameUI) { temp.SetActive(false); } canMove[0] = true; if(launchScene.isPractice == true) { myalpha = 0; myfadeImage.color = new Color(0, 0, 0, myalpha); endDialog(); return; } co = StartCoroutine(waitForFade(0, 1.0f, false)); }
// Use this for initialization void Start() { //reference to the gameController class clickScript = GameObject.Find("GameController").GetComponent<gameController>(); }
void Awake() { manager = GameObject.FindGameObjectWithTag("GameController").GetComponent<gameController>(); manager.spawnPoints.Add(this); }
public void setGameInfo(gameController gameInfo) { this.gameInfo = gameInfo; }
// Start void Start() { yourAns = 0; gc = gameController.GetComponent<gameController>(); AnsButton.gameObject.GetComponent<Button> ().interactable = false; // TODO: あとで直す avalablePoint[1] = SettingManager.loadIntValue ("charaCost1"); avalablePoint[2] = SettingManager.loadIntValue ("charaCost2"); avalablePoint[3] = SettingManager.loadIntValue ("charaCost3"); avalablePoint[4] = SettingManager.loadIntValue ("charaCost4"); settingAttackPoint (0); // 使用可能なキャラ for (int i = 2; i <= 4; i++) { var buyString = SettingManager.loadValue("charaBuy" + i.ToString()); string buttonPath = "PlayerButton/Player" + i.ToString (); Button playerButton = canvas.transform.FindChild (buttonPath).gameObject.GetComponent<Button> (); playerButton.gameObject.SetActive( buyString == PowerUpController.BUY_STRING); } // 使用可能なレベル for (int i = 2; i <= 4; i++) { var buyString = SettingManager.loadValue("levelBuy" + i.ToString()); string buttonPath = "LevelButton/LevelButton" + i.ToString (); Button playerButton = canvas.transform.FindChild (buttonPath).gameObject.GetComponent<Button> (); playerButton.gameObject.SetActive( buyString == PowerUpController.BUY_STRING); } }
// Use this for initialization void Start() { gc=this; //when start game, did not show the esc menu canvasESCMenu.enabled=false; //us this to set the default highest score if(PlayerPrefs.GetFloat("highestScore")!=null){ highestScore=PlayerPrefs.GetFloat("highestScore"); }else{ Debug.Log("First time to store a score"); highestScore=0; } youWin.GetComponent<MeshRenderer>().enabled=false; youLost.GetComponent<MeshRenderer>().enabled=false; rows=(int)(Mathf.Pow(numOfCubes,1f/3)); //use 1f/3 not 1/3 cubesArray=CreateCubesArray(numOfCubes); // minesArray=new Vector3[]{new Vector3(-2f,-2f,-2f),new Vector3(0f,0f,0f),new Vector3(2,-2,-2),new Vector3(2,2,2), // new Vector3(2,0,2)}; //this is an original mines position //minesIndex=GetMinesIndex(minesArray); //minesIndex=new int[] { 0, 2, 1,3,4 }; minesIndex=RandomMinesPosition(5); numCubesIndex=GetNumCubesIndex(minesIndex); spaceCubesIndex=GetSpaceCubes(); CreateMap(cubesArray,minesIndex,numCubesIndex); minesTextNum=numOfMines; spacesTextNum=spaceCubesIndex.Length; cubesTextNum=numOfCubes; }
// Use this for initialization void Start() { controller = FindObjectOfType(typeof(gameController)) as gameController; currentMaterial = renderer.material; }
// Use this for initialization void Start() { animatorPlayer = mesh.GetComponent<Animator>(); controller = FindObjectOfType(typeof (gameController)) as gameController; }
private CanvasGroup visibility; // Referance to the canvasGroup component #endregion Fields #region Methods void Start() { manager = GameObject.FindGameObjectWithTag ("GameController").GetComponent<gameController>(); GameObject tempPlayer; if (manager.settings == null) { if (playerNumber == 1) { tempPlayer = GameObject.Find ("Player 1(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 1 doesn't exist"); } } else if (playerNumber == 2) { tempPlayer = GameObject.Find ("Player 2(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 2 doesn't exist"); } } else if (playerNumber == 3) { tempPlayer = GameObject.Find ("Player 3(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 3 doesn't exist"); } } else { tempPlayer = GameObject.Find ("Player 4(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 4 doesn't exist"); } } //healthBar = GetComponent<Image> (); //startingColour = player.transform.FindChild ("characterModel").FindChild ("goo_man").renderer.material.color; } else { if (playerNumber == 1) { tempPlayer = GameObject.Find ("Player 1(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 1 doesn't exist"); } } else if (playerNumber == 2) { tempPlayer = GameObject.Find ("Player 2(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 2 doesn't exist"); } } else if (playerNumber == 3) { tempPlayer = GameObject.Find ("Player 3(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 3 doesn't exist"); } } else { tempPlayer = GameObject.Find ("Player 4(Clone)"); if (tempPlayer != null) { player = tempPlayer.GetComponent<playerCharacter> (); } else { Debug.Log ("player 4 doesn't exist"); } } } healthBar = GetComponent<Image> (); if(player != null) { startingColour = player.transform.FindChild ("characterModel").FindChild ("goo_man").renderer.material.color; } else { healthBar.color = new Color(0,0,0,0); gameObject.SetActive(false); } }
void Awake() { manager = GameObject.FindGameObjectWithTag ("GameController").GetComponent<gameController>(); controllerInput = GetComponent<XboxControls> (); Box = GetComponentInChildren<hitBox>(); Slam = GetComponentInChildren<slam> (); manager.players.Add (this); animator = GetComponentInChildren<Animator> (); spinning = GetComponentInChildren<fastHammerPhysics> (); rigidBody = GetComponent<RigidBodyControls> (); gravityValue = rigidBody.gravity; if (manager.settings != null) { lives = manager.settings.lives; } healthMax = health; stunParticles = transform.FindChild ("stun").gameObject; manager.alivePlayers.Add (this); soundEffect = GetComponent<playerSFX> (); myAudio = GetComponent<AudioSource> (); }
//networking stuff // protected NetworkInstanceId mynetworkID; // Use this for initialization protected virtual void Awake() { // Setup player attributes currentHealth = startingHealth; currentMana = startingMana; myblockController = transform.Find("block").GetComponent<blockController>(); myUltiCamera = GameObject.FindGameObjectWithTag("ultimateCamera").GetComponent<ultimateCameraController>(); mymelee = transform.Find ("melee trigger box").GetComponent<melee> (); myaudio = GetComponent<AudioSource>(); rb = GetComponent<Rigidbody> (); isInUltimate = false; isJumping = false; isAttack = false; isCastMode = false; playBlockAnimation = false; isLose = false; canMove = true; isWalking = false; isPause = false; canCastUltimate = true; isGodMode = false; isUnlimitedSpell = false; isNotEnoughMana = false; isKnockBack = true; isEndOfRangeAttack = true; isFinishCombo = true; isUseHealthItem = false; isUseManaItem = false; isStun = false; isCrouch = false; canCombo = false; shouldWaitAnimationFinish = false; isBlocking = false; isDoubleTap = false; canRangeAttack = true; canMeleeAttack = true; speed = normalSpeed; jumpSpeed = lowJumpSpeed; comboCount = 0; myDamageMultipler = 1.0f;//default highestComboAchieve = 0; blockCount = maxBlockCount; stunRate = 1;//default spellCoolDownRate = 1;//how fast the spell cooldown, 1 is normal rate CurrentChargingBar = Mathf.Clamp01 (CurrentChargingBar); myGameController = GameObject.Find ("gameManager").GetComponent<gameController> (); //coolDownRangeTimer = coolDownRangeAttackRate; coolDownRangeTimer = 0; coolDownMeleeTimer = new float[2]; coolDownMeleeTimer[0] = coolDownMeleeAttackRate; isMeleeComboCount = new bool[3]; for (int i = 0; i < isMeleeComboCount.Length; i++) isMeleeComboCount[i] = false;//for melee combo animation myblockTimer = coolDownBlockTimer; stunTimer = coolDownStunRate; comboText = combo.GetComponent<Text>(); comboAnimation = combo.GetComponent<Animation>(); spellComboArmor = new float[3]; spellComboActive = new float[3]; spellComboPassive = new float[3]; for (int i = 0; i < spellComboArmor.Length; i++) { spellComboArmor[i] = 0; spellComboActive[i] = 0; spellComboPassive[i] = 0; } canCastSpell = new bool[3]; for (int i = 0; i < canCastSpell.Length; i++) canCastSpell[i] = true; StartCoroutine (regenMana (1.0f)); StartCoroutine(regenBlockCount(5.0f)); }
void Start() { localRect = GetComponent<RectTransform>(); controller = gameController.instance; }
void Start() { GameObject gameControllerObj = GameObject.FindWithTag("GameController"); gameControllerScript = (gameController)gameControllerObj.GetComponent("gameController"); enemyDistance = Random.Range(2.0F, 3.0F); damege = 0; isAcceptDamage = false; //AudioSourceコンポーネントを取得し、変数に格納 sound01 = GetComponent<AudioSource>(); changeStatus(ACTION_STATE.CHARACTER_MOVE_START); }