private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private bool isWinner() { if (GManager.WinnerPlayer(Board, FirstPlayer, SecondPlayer) == null) { return(false); } else { return(true); } }
private void Awake() { if (gManagerInstance == null) { gManagerInstance = this; } else { Destroy(this); } }
private void Start() { this.rb = GetComponent <Rigidbody2D>(); this.animator = GetComponent <Animator>(); obj = this.transform.Find("Punch_obj").gameObject; col = obj.GetComponent <BoxCollider2D>(); psm = StatusManager.GetComponent <PlayerStatusManager>(); gm = GManager.GetComponent <GManager>(); }
// Use this for initialization void Start() { colors = new Dictionary <int, Material>(); if (main == null) { main = this; } colors.Add(0, team1); colors.Add(1, team2); }
void Start() { anim = GetComponent <Animator>(); sprite = GetComponent <SpriteRenderer>(); aSource = GetComponent <AudioSource>(); gManager = FindObjectOfType <GManager>(); gmASource = gManager.GetComponent <AudioSource>(); firingCd = fireRate + 2; target = FindObjectOfType <ShipControler>(); Debug.Log("Spawned ship: " + shipID); anim.SetInteger("ID", shipID); }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
// Use this for initialization void Start() { manager = GameObject.FindWithTag("MainCamera").GetComponent <GManager>(); //INIT COORD POSITIONS curCoord = new Vector2Int { x = Mathf.RoundToInt(transform.position.x - manager.gridZero.x), y = Mathf.RoundToInt(transform.position.y - manager.gridZero.y) }; targetCoord = curCoord; }
// Use this for initialization void Start() { manager = GameObject.FindWithTag("MainCamera").GetComponent <GManager>(); state = bState.mblock; //Initialize Player Pos Coord. curCoord = new Vector2Int { x = Mathf.RoundToInt(transform.position.x - manager.gridZero.x), y = Mathf.RoundToInt(transform.position.y - manager.gridZero.y) }; targetCoord = curCoord; }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); gManager = FindObjectOfType <GManager>(); audioSource = GetComponent <AudioSource>(); cameraFollow = FindObjectOfType <CameraFollow>(); initialPosition = transform.position; initialHorizontalSpeed = horizontalSpeed; initialVerticalSpeed = verticalSpeed; powerUpTimer = powerUpInterval; }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody>(); reticle = canvas.transform.GetChild(0).GetComponent <Reticle>(); animator = GetComponent <Animator>(); gManager = FindObjectOfType <GManager>(); reticleTransform = reticle.GetComponent <RectTransform>(); reticleHeight = reticleTransform.anchoredPosition.y; audioSource = GetComponent <AudioSource>(); reticle.Charge(fireDelay * 3); nextFire = Time.time + fireDelay * 3; }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); //So only one Game Manager can exist at a time. } gameoverTextStatus = false; }
// Use this for initialization void Start () { startRotation = GameObject.Find("ThrowArmBoneStart").GetComponent<Transform>(); uprightRotation = GameObject.Find("ThrowArmBoneUpright").GetComponent<Transform>(); endRotation = GameObject.Find("ThrowArmBoneEnd").GetComponent<Transform>(); endBackTiltRotation = GameObject.Find("ThrowArmBoneEndBackTilt").GetComponent<Transform>(); liftingUp = true; charging = false; GManager = GameObject.Find("GManager").GetComponent<GManager>(); thisRB = GetComponent<Rigidbody>(); gameObject.tag = "Untagged"; }
void Start() { gameManager = FindObjectOfType <GManager>(); model = GameObject.FindWithTag("PlagueDoctor"); mesh = model.GetComponent <SkinnedMeshRenderer>(); defaultColor = mesh.material.GetColor("_Color"); controller = gameObject.GetComponent <CharacterController>(); animator = gameObject.GetComponent <Animator>(); innerCastTimer = castTimer; playerSpeed = walkSpeed; playerCurrentHealth = playerMaxHealth; }
/// use this method to various sounds reload. /// if you have only 1 sound, them put only one in inspector /// and leave emty other box IEnumerator ReloadSoundIE() { float t_time = reloadTime / 3; if (ReloadSound != null) { GetComponent <AudioSource>().clip = ReloadSound; GetComponent <AudioSource>().Play(); if (GManager != null) { GManager.heatReloadAnim(1); } } if (ReloadSound2 != null) { if (typeOfGun == weaponType.Shotgun) { int t_repeat = bulletsPerClip - bulletsLeft; for (int i = 0; i < t_repeat; i++) { yield return(new WaitForSeconds(t_time / t_repeat + 0.025f)); GetComponent <AudioSource>().clip = ReloadSound2; GetComponent <AudioSource>().Play(); } } else { yield return(new WaitForSeconds(t_time)); GetComponent <AudioSource>().clip = ReloadSound2; GetComponent <AudioSource>().Play(); } } if (ReloadSound3 != null) { yield return(new WaitForSeconds(t_time)); GetComponent <AudioSource>().clip = ReloadSound3; GetComponent <AudioSource>().Play(); if (GManager != null) { GManager.heatReloadAnim(2); } } yield return(new WaitForSeconds(0.65f)); if (GManager != null) { GManager.heatReloadAnim(0); } }
/// <summary> /// use this method to various sounds reload. /// if you have only 1 sound, them put only one in inspector /// and leave empty other box /// </summary> /// <returns></returns> IEnumerator ReloadSoundIE() { float t_time = Info.ReloadTime / 3; if (ReloadSound != null) { Source.clip = ReloadSound; Source.Play(); if (GManager != null) { GManager.heatReloadAnim(1); } } if (ReloadSound2 != null) { if (Info.Type == GunType.Shotgun) { int t_repeat = bulletsPerClip - bulletsLeft; for (int i = 0; i < t_repeat; i++) { yield return(new WaitForSeconds(t_time / t_repeat + 0.025f)); Source.clip = ReloadSound2; Source.Play(); } } else { yield return(new WaitForSeconds(t_time)); Source.clip = ReloadSound2; Source.Play(); } } if (ReloadSound3 != null) { yield return(new WaitForSeconds(t_time)); Source.clip = ReloadSound3; Source.Play(); if (GManager != null) { GManager.heatReloadAnim(2); } } yield return(new WaitForSeconds(0.65f)); if (GManager != null) { GManager.heatReloadAnim(0); } }
// Use this for initialization void Awake() { Input.backButtonLeavesApp = true; self = this; colorMap[0] = Color.green; colorMap[1] = Color.blue; colorMap[2] = new Color(0f, 1f, 1f); colorMap[3] = Color.black; colorMap[4] = Color.red; colorMap[5] = new Color(1f, 0f, 1f); colorMap[6] = new Color(1f, 1f, 0f); Mesh tileMesh = TilePrefab.GetComponent <MeshFilter>().sharedMesh; baseMainVerts = tileMesh.vertices; convertToSides(tileMesh, baseMainVerts, ref sideVerts); tileMesh.vertices = baseMainVerts; sideView = false; inventory = new Inventory(GameObject.FindGameObjectWithTag("inventory"), false); equipment = new Inventory(GameObject.FindGameObjectWithTag("equipS"), true); myCam = GameObject.FindGameObjectWithTag("Cam2").GetComponent <Camera> (); mainCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera> (); soundUI = myCam.transform.GetChild(1).GetComponent <AudioSource> (); soundEquip = myCam.transform.GetChild(2).GetComponent <AudioSource> (); playerLocation = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform> (); //playerAnim = playerLocation.GetComponent<Animator> (); //playerFollowL = GameObject.FindGameObjectWithTag ("PlayerFollow").GetComponent<Transform> (); UIInventory.SetActive(false); UINormal.SetActive(false); UIEdit.SetActive(false); UIMove.SetActive(false); UIChat.SetActive(false); UIStats.SetActive(false); UIHaS.SetActive(false); UICompass.SetActive(false); UIOptions.SetActive(false); chCam = chatCam.GetComponent <Camera> (); chCam.enabled = false; //chatCam.SetActive (false); selBox = GameObject.FindGameObjectWithTag("selectBox"); selCirc = GameObject.FindGameObjectWithTag("selectCircle"); selBox.SetActive(false); selCirc.SetActive(false); selectBox = selBox; foreach (EnemyType type in Enum.GetValues(EnemyType.archer.GetType())) { GameObject prefab = Resources.Load <GameObject>("Prefabs/enemy/" + type.ToString()); enemyPrefabs.Add(type, prefab); } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); instance.InitGame(); }
//=============================================== public void run_CONFIG_SHARP_SHOW_SCHEMA(string[] args) { Console.Write("\n"); string lQuery = String.Format(@" select sql from sqlite_master where type = 'table' and name = 'config_data' "); string lValue = GSQLite.Instance().queryValue(lQuery); GManager.Instance().showData(lValue); G_STATE = "S_SAVE"; }
private void Awake() { if (instance == null) { instance = this; // シーン切替時に破棄されないようにする DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
public void Start() { canMove = false; canTakeDamage = true; shootPoint = getChildGameObject("ShootPoint"); hp = maxHp; reloadTime = maxReloadTime; bullets = maxBullets; audiomanager = GameObject.Find("_AudioManager").GetComponent <AudioManager> (); gmanager = GameObject.Find("_GM").GetComponent <GManager> (); inputmanager = GameObject.Find("_InputManager").GetComponent <InputManager> (); StartCoroutine(primeiraAttUIs()); }
public static void Change(Transform parent, bool remove) { if (!remove) { GManager.SetLayerRec(parent.gameObject, LayerMask.NameToLayer("Chat")); } if (self.transform.parent != null) { GManager.SetLayerRec(self.transform.parent.gameObject, LayerMask.NameToLayer("Default")); } self.transform.parent = (remove)?null:parent; self.transform.localPosition = GManager.chatCamPos; self.transform.localRotation = Quaternion.Euler(GManager.chatCamRot); }
//=============================================== // method //=============================================== public void run(string[] args) { sGApp lApp = GManager.Instance().getData().app; CvInvoke.NamedWindow(lApp.app_name); Mat lImg = new Mat(lApp.win_height, lApp.win_width, DepthType.Cv8U, 3); lImg.SetTo(lApp.win_bg_color.MCvScalar); CvInvoke.PutText(lImg, "Bonjour tout le monde", new System.Drawing.Point(10, 80), FontFace.HersheyComplex, 1.0, lApp.win_fg_color.MCvScalar); CvInvoke.Imshow(lApp.app_name, lImg); CvInvoke.WaitKey(0); CvInvoke.DestroyAllWindows(); }
// Start is called before the first frame update void Start() { gm = GManager.GetInstance(); scoreText = GetComponent <Text>(); if (gm != null) { SetScoreText(gm.score); } else { Debug.Log("ゲームマネージャがありません"); Destroy(this); } }
/// When we disable the gun ship called the animation /// and disable the basic functions public void DisableWeapon() { CanAim = false; isReloading = false; CanFire = false; if (Animat) { Animat.HideWeapon(); } if (GManager != null) { GManager.heatReloadAnim(0); } StopAllCoroutines(); }
void Start() { audioSource = this.GetComponent <AudioSource>(); boxCollider = this.GetComponent <BoxCollider2D>(); gManager = GameObject.Find("GManager"); gm = gManager.GetComponent <GManager>(); enemyHP = GameObject.Find("EnemyHP").GetComponent <Slider>(); enemyHP.maxValue = enemyMaxHP; enemyHP.value = 0; isStart = false; isNext = false; }
private void OnLoad() { string playerToLoad = GManager.Instance.ReadNextObjectToLoad(); _thisTransform.name = GManager.FindStringParameterInObject(playerToLoad, "_thisTransform.name"); _thisTransform.position = GManager.FindVector3InObject(playerToLoad, "_thisTransform.position"); _rigidbody.velocity = GManager.FindVector2InObject(playerToLoad, "_rigidbody.velocity"); health = GManager.FindFloatParamInSObject(playerToLoad, "Player.health"); _directionState = (directionState)Enum.Parse(typeof(directionState), GManager.FindStringParameterInObject(playerToLoad, "Player._directionState", "", "")); _forceState = (forceState)Enum.Parse(typeof(forceState), GManager.FindStringParameterInObject(playerToLoad, "Player._forceState", "", "")); _moveState = (moveState)Enum.Parse(typeof(moveState), GManager.FindStringParameterInObject(playerToLoad, "Player._moveState", "", "")); _lowHealthWarning = false; UIPlayer.SetHealth(health); }
public void GameCycle() { bool isPlayerCanMove = true; int option = 0; while (!isWinner()) { Player ActivePlayer = GManager.WhoseTurn(FirstPlayer, SecondPlayer); ConsoleDraw.DrawAskToThrow(GManager.AskPlayersForThrow(GameDice, FirstPlayer, SecondPlayer), GameDice, Board); GManager.UpdateMoves(GameDice, ActivePlayer); isPlayerCanMove = GManager.isAvailableMoves(Board, GameDice, FirstPlayer, SecondPlayer); if (isPlayerCanMove) { while (ActivePlayer.Moves > 0) { if (isWinner()) { break; } else { GManager.AskPlayersForMove(Board, GameDice, FirstPlayer, SecondPlayer, ConsoleDraw.DrawAskToMove(GManager.WhoseTurn(FirstPlayer, SecondPlayer), GameDice, Board)); } } } else { ConsoleDraw.DrawNoAvailableMoves(GManager.WhoseTurn(FirstPlayer, SecondPlayer), Board, GameDice); GManager.ChangePlayersTurn(FirstPlayer, SecondPlayer); } } option = ConsoleDraw.DrawWinner(GManager.WinnerPlayer(Board, FirstPlayer, SecondPlayer)); if (option == 1) { StartGame(); } else { ConsoleDraw.DrawGoodBye(); } }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); curScene = SceneManager.GetActiveScene().name; generateLevel(); }
void Start() { #if UNITY_ANDROID && !UNITY_EDITOR AndroidJavaClass unityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject unityObj = unityClass.GetStatic<AndroidJavaObject>("currentActivity"); if(unityObj!= null) { using (NUPProjectPluginClass = new AndroidJavaClass ("com.anuragzzz.nupproject.NUPProjectActivity")) { if (NUPProjectPluginClass != null) { NUPProjectPluginClass.CallStatic("setContext", unityObj); currentAndroidActivity = NUPProjectPluginClass.CallStatic<AndroidJavaObject> ("instance"); } } } #endif Debug.Log ("Progression 01"); GA_Progression.NewEvent(GA_Progression.GAProgressionStatus.GAProgressionStatusStart, "TestSceneDefault"); lastTimeScaleBeforePause = 1f; HUDCanvasGO = (Canvas)Instantiate(HUD_Canvas); Canvas pauseCanvasGO = (Canvas)Instantiate(pause_Canvas); HUDCanvasGO.transform.GetComponent<ObjectReferences>().references[0].go.GetComponent<Button>().onClick.AddListener(() => SetPause(true)); HUDCanvasGO.transform.GetComponent<ObjectReferences>().references[1].go.GetComponent<Button>().onClick.AddListener(() => StartDownloadingSpriteAsset()); //TakeScreenBro()); HUDCanvasGO.transform.GetComponent<ObjectReferences>().references[3].go.GetComponent<Button>().onClick.AddListener(() => TryToPlayAd()); //StartDownLOADING()); //LabelVolumeButton()); pause_Controller = pauseCanvasGO.gameObject.GetComponent<GManager>(); pause_Controller._resumeButton.onClick.AddListener(() => SetPause(false)); alertVFX = HUDCanvasGO.transform.GetComponent<ObjectReferences>().references[2].go.GetComponent<Image>(); alertVFX.gameObject.SetActive(false); HelpCanvasGO = (Canvas)Instantiate(Help_Canvas); HelpCanvasGO.GetComponent<ObjectReferences>().references[1].go.GetComponent<Button>().onClick.AddListener(() => HideUIHelp()); helpImg = HelpCanvasGO.GetComponent<ObjectReferences>().references[0].go.GetComponent<Image>(); HelpCanvasGO.gameObject.SetActive(false); // Assign any AdColony Delegates before calling Configure AdColony.OnVideoFinished = this.OnVideoFinished; // If you wish to use a the customID feature, you should call that now. // Then, configure AdColony: AdColony.Configure ( "version:1.0,store:google", // Arbitrary app version and Android app store declaration. "app96f59028498a45f8a0", // ADC App ID from adcolony.com "vz447d3436aa514ac2ac" ); }