// Use this for initialization void Start() { ninjaScript = ninjaObject.GetComponent <NinjaAI>(); gameManagerScript = rig.GetComponent <_GameManager>(); playerSwordTriggerScript = playerSword.GetComponent <PlayerSwordTrigger>(); //currentSword = this.GetComponent<GameObject>(); }
// Update is called once per frame private void Awake() { pickupCount = 0; m_Rigidbody = GetComponent <Rigidbody>(); countText.text = "Resource: " + pickupCount.ToString(); _gameManager = FindObjectOfType <_GameManager>(); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "Player") { GameObject manager = GameObject.Find("Manager"); _GameManager scriptMa = manager.GetComponent <_GameManager>(); switch (this.gameObject.name) { case "Sheep(Clone)": scriptMa.Food = 0.01f + scriptMa.Food; break; case "Duck(Clone)": scriptMa.Food = 0.02f + scriptMa.Food; break; case "FlowerMonster(Clone)": scriptMa.Food = 0.03f + scriptMa.Food; break; case "MoleMonster(Clone)": scriptMa.Food = 0.03f + scriptMa.Food; break; case "Penquin(Clone)": scriptMa.Food = 0.01f + scriptMa.Food; break; } Destroy(this.gameObject); } }
void Start() { playerPhysics = GetComponent <PlayerPhysicsTest> (); animator = GetComponent <Animator> (); manager = Camera.main.GetComponent <_GameManager>(); animator.SetLayerWeight(1, 1); }
private void Start() { ManagerObj = GameObject.Find("Manager"); manager = ManagerObj.GetComponent <_GameManager>(); TText = TerrianObj.GetComponent <Text>(); TerrianMenu(); }
//Singleton so there is only ever one instacne of the game mamanager. public _GameManager() { if (singleton != null) { throw new System.Exception("You can only have one _Gamemanager object! Remove one instance"); } singleton = this; _currentLevel = 0; }
void Start() { _gm = transform.parent.GetComponentInChildren <_GameManager>(); curLevel = levels[0]; _gm._GUI.getAudioSources(); _gm._GUI.setLevelAudio(); _gm.GameOver += EndGame; }
private void Start() { ObjManger = GameObject.Find("Manager"); manager = ObjManger.GetComponent <_GameManager>(); ObjUI = GameObject.Find("UI"); storeUI = ObjUI.GetComponent <Store_UI>(); img = this.GetComponent <Image>(); img.sprite = sprite; }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
private void Start() { swordMovementScript = playerSword.GetComponent <SwordMovement>(); gameManagerScript = rig.GetComponent <_GameManager>(); animator = this.GetComponent <Animator>(); rigidBody = GetComponent <Rigidbody>(); ResetValues(); playerHealth = 100; aiHealth = 100; playerStartingHealth = playerHealth; aiStartingHealth = aiHealth; }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; //DontDestroyOnLoad(this); } }
public void _MakeSingleInstance() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
//XML데이터도 다른데에 박아두는게 나을 것 같다 // Use this for initialization void Start() { instance = this; DontDestroyOnLoad(gameObject);//다른 씬을 로드해도 파괴되지 않음. //XMLData init LoadXML(); // Init(); OpenMainStage("BT1"); }
void Start() { if (!_gm) { _gm = GameObject.Find("_GameManager").GetComponent <_GameManager>(); } if (!_base) { _base = GetComponent <ActorBase>(); } _base.myOppElement = _base.setOppElement(); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (instance != this) { Destroy(this.gameObject); return; } }
void Singleton() { if (_instance == null) { _instance = this; } else if (_instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void Initialize() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); db = GetComponent <_GameManagerDB> (); camPanner = GetComponent <CameraPanner> (); } else { DestroyImmediate(gameObject); } }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } photonView = GetComponent <PhotonView>(); }
public void InitiateKnight() { GM = GameObject.Find("Game Manager").GetComponent <_GameManager>(); Class = GM.GetUnitClass(this.gameObject); MaxHealth = 50; Health = MaxHealth; AttackDamage = 10; Range = 3; AttackSpeed = 1.5f; ProjectileSpeed = 0; Nav = GetComponent <NavMeshAgent>(); }
public void InitiateArcher() { GM = GameObject.Find("Game Manager").GetComponent <_GameManager>(); Class = GM.GetUnitClass(this.gameObject); MaxHealth = 25; Health = MaxHealth; AttackDamage = 20; Range = 40; AttackSpeed = 5f; ProjectileSpeed = 100; Nav = GetComponent <NavMeshAgent>(); }
private void Start() { //Screen.SetResolution(1920, 1080, false); Instance = this; isStartGame = false; myOnlineCount = 0; if (isNoDestroyHandler) { DontDestroyOnLoad(gameObject); isNoDestroyHandler = false; } #if SERVER OnClickHost(); #endif }
// Start is called before the first frame update void Start() { GM = GameObject.Find("Game Manager").GetComponent <_GameManager>(); PL = GameObject.Find("Game Manager").GetComponent <_Player>(); Prefab = GameObject.Find("Game Manager").GetComponent <_Prefab>(); // INITIALISE PARTS OF THE UI INIT_GameManagement(); INIT_Currency(); INIT_BarracksUI(); INIT_WaveUI(); INIT_HealthBarUI(); INIT_SpacialUI(); }
private void Awake() { if (instance == null) { instance = this; } if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(this); SceneManager.sceneLoaded += StartGame; }
private void Awake() { //Time.timeScale = 1; if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } // Prevent the game manager from being destroyed while loading scenes // DontDestroyOnLoad(gameObject); }
private void Awake() { if (_GameManager.sharedInstance == null) { _GameManager.sharedInstance = this; } else if (_GameManager.sharedInstance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); boardScript = GetComponent <_BoardManager>(); recordLevelText = GameObject.Find("RecordLevelText").GetComponent <Text>(); }
// Start is called before the first frame update void Start() { CheckStartingAnim(); GM = GameObject.FindGameObjectWithTag("GameManager").GetComponent <_GameManager>(); if (GM.isMultiplayer) { GameObject[] ships = GameObject.FindGameObjectsWithTag("Player"); ship = ships[Random.Range(0, 2)]; } else { ship = GameObject.FindGameObjectWithTag("Player"); } DetermineSpeed(); DetermineRotation(); ShootAsteroid(); }
private void Start() { GlobalObj = GameObject.Find("ProgramingUI"); ObjString = GameObject.Find("StringInput"); ObjInt = GameObject.Find("IntInput"); ObjString.SetActive(true); ObjInt.SetActive(false); if (GlobalObj != null) { GlobalObj.SetActive(false); } ObjManager = GameObject.Find("Manager"); if (ObjManager != null) { manager = ObjManager.GetComponent <_GameManager>(); } }
private void Start() { StoreUI = GameObject.Find("UI"); ObjManger = GameObject.Find("Manager"); manager = ObjManger.GetComponent <_GameManager>(); thisButton = this.GetComponent <Button>(); if (createOnce) { GameObject startPointer = (GameObject)Instantiate(mousePointer.gameObject, Vector3.zero, Quaternion.identity); startPointer.name = "MousePointer"; startPointer.tag = "Pointer"; mousePointer = startPointer; createOnce = false; } }
void Awake() { instance = this; }
void OnNetworkLoadedLevel () { _nc = FindObjectOfType(typeof(_GameManager)) as _GameManager; }
void Start(){ _nc = FindObjectOfType(typeof(_GameManager)) as _GameManager; menuState = MenuState.MainMenu; T_style = GameObject.Find("_GameManager").GetComponent<Console>().textStyle; }