void Start() { fxManager = GameObject.FindObjectOfType<FXManager>(); if(fxManager == null) { Debug.LogError("Couldn't find an FXManager."); } }
void Awake() { s_Instance = this; if(!GameObject.Find("FXManager")) { DontDestroyOnLoad(gameObject); } }
// Create Bat Destroyed method public void Kill() { EnemyManager.Get().GetBats().Remove(gameObject); FXManager.Get().PlaySFX("sfx/Splat 2", Random.Range(0, 5), 0.1F); GameManager.Get().SpawnParticles(transform.position, Color.black); FXManager.Get().DoHitPause(); Destroy(gameObject); }
public AudioManager() { gameObject = new GameObject("AudioManager"); gameObject.AddComponent<AudioListener>(); //we don't need a reference to it, we just need it to exist musicManager = new MusicManager(this); fxManager = new FXManager(this); }
public override void Effect() { base.Effect(); clone = GameObject.Instantiate(character.gameObject); animator.speed = 0f; GameController.GetInstance().Invoke(() => { render = character.Find("Render").gameObject; FXManager.GetInstance().SmokeSpawn(character.position, character.rotation, null); render.SetActive(false); }, 0.6f); GameController.GetInstance().Invoke(() => { FXManager.GetInstance().SmokeSpawn(focus, character.rotation, null); FXManager.GetInstance().SmokeSpawn(character.position, character.rotation, null); animator.speed = 1f; }, 1.4f); GameController.GetInstance().Invoke(() => { if (switchPosition) { clone.transform.position = character.position; character.position = focus; } else { clone.transform.position = focus; } SetIdentity(clone); UnitManager.GetInstance().AddUnit(clone.GetComponent <Unit>()); clone.GetComponent <Unit>().Buffs.Add(new DirectionBuff()); clone.GetComponent <Animator>().Play(animator.GetCurrentAnimatorStateInfo(0).fullPathHash, 0, animator.GetCurrentAnimatorStateInfo(0).normalizedTime); clone.GetComponent <Animator>().SetInteger("Skill", 0); character.GetComponent <Unit>().UnitEnded += SetCloneEnd; render.SetActive(true); }, 1.6f); //var clone = GameObject.Instantiate(character.gameObject); //if (switchPosition) //{ // clone.transform.position = character.position; // character.position = focus; //} //else //{ // clone.transform.position = focus; //} //clone.GetComponent<CharacterStatus>().characterIdentity = CharacterStatus.CharacterIdentity.clone; //UnitManager.GetInstance().AddUnit(clone.GetComponent<Unit>()); //clone.GetComponent<Unit>().Buffs.Add(new DirectionBuff()); //clone.GetComponent<Animator>().Play(animator.GetCurrentAnimatorStateInfo(0).fullPathHash, 0, animator.GetCurrentAnimatorStateInfo(0).normalizedTime); //clone.GetComponent<Animator>().SetInteger("Skill", 0); //clone.GetComponent<Unit>().OnUnitEnd(); }
public IEnumerator Interact(HeroModel model) { yield return(model.Sleep(this)); //yield return new WaitForSeconds(1); Debug.Log("BED// Restoring " + (World.Config.restLifeHeal + " HP").Colored(Color.green) + " to Hero"); FXManager.ShowPopupAt(transform.position, "+" + World.Config.restLifeHeal + " HP", 2, Color.green); }
private void Start() { instance = this; smoke = (Resources.Load("Prefabs/Particle/Smoke") as GameObject).transform; hitPoint = (Resources.Load("Prefabs/Particle/HitPoint") as GameObject).transform; dust = (Resources.Load("Prefabs/Particle/Dust") as GameObject).transform; stub = (Resources.Load("Prefabs/Particle/Stub") as GameObject).transform; }
void Start() { audioSource = GetComponent <AudioSource>(); fxManager = GameObject.FindObjectOfType <FXManager>(); if (fxManager == null) { Debug.Log("Could not find fxManager.."); } }
public IEnumerator Interact(HeroModel model) { yield return(new WaitForSeconds(1)); Debug.Log("CASTLE// Working... :C Earned " + World.Config.workGoldPay + " gold"); model.playerGold += World.Config.workGoldPay; FXManager.ShowPopupAt(transform.position, "+" + World.Config.workGoldPay + " GOLD", 2, Color.yellow); }
void Start() { fxmanager = GameObject.FindObjectOfType <FXManager>(); if (fxmanager == null) { Debug.Log("No FXManager"); } }
void Start() { fxManager = GameObject.FindObjectOfType <FXManager> (); if (fxManager == null) { Debug.LogError("Couldn't find fxManager"); } }
void Start() { fxManager = controlledMinion.GetComponentInChildren <FXManager>(); playerRig = controlledMinion.GetComponent <Rigidbody>(); currentCameraPositionOffset = new Vector3(0, 16.93f, -7.85f); controlledMinion.GetComponentInChildren <Image>().enabled = true; currentCameraCamera = currentCamera.GetComponentInChildren <Camera>().gameObject.transform; squadManager = FindObjectOfType <GameplayManager>().squadManager; }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name.Contains("player")) { GameManager.Get().GetPlayer().GetComponent <Player>().HitPlayer(); FXManager.Get().PlaySFX("sfx/Splat 1", Random.Range(0, 3), 0.1F); Kill(); } }
private int damageRadius; //Varies for missiles & Exp Shells //**************** void Awake() { GameObject tempObject = GameObject.Find("PlayerCamera"); Camera playerCamera = tempObject.GetComponent <Camera>(); // sfx = tempObject.GetComponent <FXManager>(); // tempObject = GameObject.Find("A_Scene_Manager"); SceneManager = tempObject.GetComponent <ScriptASceneManager>(); }
public void EndDash() { FXManager.StopGhostFX(transform.Find("Model").gameObject); if (dashCoroutine != null) { StopCoroutine(dashCoroutine); } healthState = HealthState.Normal; UnFreeze(); }
private void Awake() { Application.targetFrameRate = 60; _dataManager = FindObjectOfType <DataManager>(); _roadManager = FindObjectOfType <RoadManager>(); _player = FindObjectOfType <MovePlayer>(); _scoreManager = FindObjectOfType <ScoreManager>(); _uiManager = FindObjectOfType <UIManager>(); _fxManager = FindObjectOfType <FXManager>(); }
//------------------- // AWAKE //------------------- void Awake() { pointsValue = 1500; armour = 5; // subtracted from any hit damage values this enemy may receive bulletXY = new Vector3[4]; //for 4 BARRELS: offsets on the end of the turret Gun: 2x2 grid bulletXY[0] = new Vector3(0, 0, 0); bulletXY[1] = new Vector3(0, 0, 0); bulletXY[2] = new Vector3(0, 0, 0); bulletXY[3] = new Vector3(0, 0, 0); turretZOffset = 0f; // Makes Missile appear on end of 'barrel' Z and not from its pivot point state = mode.passive; attackRadius = 350; blindRadius = 100; // Switches off the targeting if too close GameObject tempObject = GameObject.Find("GunView"); target = tempObject.transform; tempObject = GameObject.Find("PlayerCamera"); playerCamera = tempObject.GetComponent <Camera>(); // sfx = tempObject.GetComponent <FXManager>(); // //Find and get INPUT MANAGER SCRIPT - Totally necessary :) tempObject = GameObject.Find("A_GameWrapper"); inp = tempObject.GetComponent <ScriptAInputManager>(); // tempObject = GameObject.Find("A_Scene_Manager"); sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]' file necessary // NGUI LABELS POOL tempObject = GameObject.Find("A_Null_Labels"); pointsScript = tempObject.GetComponent <ScriptPointsManager>(); // Get Turret hinge for (int i = 0; i < transform.childCount; i++) { Transform c = transform.GetChild(i); if (c.name == "turntable") { hinge = c; } } // Get turret //for (int i = 0; i < hinge.transform.childCount; i++) { Transform c = hinge.transform.GetChild(i); if (c.name == "gun") { turret = c; } } }
void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
public void GameOver() { //Game over Screen, music, etc //Debug.Log("Game Over"); FXManager.Get().SetMusic(null); FXManager.Get().PlaySFX("sfx/game over", 0F, 0.5F); m_player.SetActive(false); m_player.GetComponent <Player>().m_gun.SetActive(false); StartCoroutine(Co_LoseCard()); }
public IEnumerator Interact(HeroModel model) { Debug.Log("TRAINING ZONE// Estoy entrenanding :)"); yield return(new WaitForSeconds(1)); model.CharacterMaxLife += World.Config.trainMaxLifeIncr; model.playerBaseAtk += model.currentWeapon == "Sword" ? World.Config.trainAtkIncr * World.Config.trainWithWeaponMultiplier : World.Config.trainAtkIncr; model.ConsumeWeapon(World.Config.trainWeaponUses); FXManager.ShowPopupAt(transform.position, "Level Up!", 2, Color.yellow); }
protected override bool ApplyEffects() { FXManager.GetInstance().SmokeSpawn(focus, character.rotation, null); RoundManager.GetInstance().Invoke(() => { character.position = focus; render.SetActive(true); }, 0.2f); range.Delete(); return(true); }
void Start() { m_inputAllowed = true; if (m_rigidbody == null) { m_rigidbody = GetComponent <Rigidbody>(); } if (m_fxManager == null) { m_fxManager = GetComponent <FXManager>(); } }
void Start() { this.speed = 0.015f; this.canMove = true; this.isSit = false; gameStart = false; this.animator = GetComponent <Animator> (); fxManager = GameObject.Find("FXManager").GetComponent <FXManager> (); StartCoroutine(Instructions()); StartCoroutine(GameStart()); }
public List <GameObject> fxObjects; //Añadimos los prefabs que sean sistemas de partículas private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
public override IEnumerator ReceiveDmg(float dmg, CharacterModel model) { yield return(base.ReceiveDmg(dmg, model)); if (CharacterCurrLife < World.Config.playerInjuredLife) { playerSeriouslyInjured = true; bloodParticles.Play(); } FXManager.ShowPopupAt(transform.position, "-" + dmg + " HP", 2, Color.red); yield return(null); }
private void OnStarshipStrike(uint uid, object cookie) { SmartEntity smartEntity = (SmartEntity)cookie; string assetName = string.Format(smartEntity.BuildingComp.BuildingType.DestructFX, new object[] { smartEntity.BuildingComp.BuildingType.SizeX, smartEntity.BuildingComp.BuildingType.SizeY }); FXManager fXManager = Service.Get <FXManager>(); fXManager.CreateAndAttachFXToEntity(smartEntity, assetName, "TrapDestruction", null, false, Vector3.zero, false); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else if (instance != this) { Destroy(gameObject); } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
//------------------- // AWAKE //------------------- void Awake() { pointsValue = 850; armour = 15; // subtracted from any hit damage values this enemy may receive state = mode.passive; attackRadius = 260; blindRadius = 70; // Switches off the targeting if too close GameObject tempObject = GameObject.Find("GunView"); target = tempObject.transform; tempObject = GameObject.Find("PlayerCamera"); playerCamera = tempObject.GetComponent <Camera>(); // sfx = tempObject.GetComponent <FXManager>(); // //Find and get INPUT MANAGER SCRIPT - Totally necessary :) tempObject = GameObject.Find("A_GameWrapper"); inp = tempObject.GetComponent <ScriptAInputManager>(); // tempObject = GameObject.Find("A_Scene_Manager"); sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]' file necessary // NGUI LABELS POOL tempObject = GameObject.Find("A_Null_Labels"); pointsScript = tempObject.GetComponent <ScriptPointsManager>(); // Get Turret hinge for (int i = 0; i < transform.childCount; i++) { Transform c = transform.GetChild(i); if (c.name == "turret") { hinge = c; } } if (hinge) { for (int i = 0; i < hinge.transform.childCount; i++) { Transform c = hinge.transform.GetChild(i); if (c.name == "gun") { turret = c; } } } }
public void Reinitiate() { _player = GameObject.FindGameObjectWithTag("Player"); fXManager = _player.GetComponent <FXManager>(); playerMovements = _player.GetComponent <PlayerMovements>(); _jumpSFX = GameObject.Find("Jump_SFX").GetComponent <AudioSource>(); _dashSFX = GameObject.Find("Dash_SFX").GetComponent <AudioSource>(); _inputsPanel = GameObject.Find("Inputs_Panel"); if (SceneManager.GetActiveScene().buildIndex != 1) { _inputsPanel.SetActive(false); } }
protected override bool ApplyEffects() { FXManager.GetInstance().SmokeSpawn(focus, character.rotation, null); RoundManager.GetInstance().Invoke(() => { character.position = focus; render.SetActive(true); var pair = SkillManager.GetInstance().skillQueue.Peek(); ((UnitSkill)pair.Key).Complete(); }, 0.2f); range.Delete(); return(true); }
private void Start() { if (allHealth == null) { allHealth = new List <Health>(); } allHealth.Add(this); Init(); fxManager = GameManager.ActiveGameManager.FXManager; }
public void ToggleCredits() { FXManager.Get().PlaySFX("sfx/Menu Click 1", Random.Range(0, 2), 1F); m_creditsPanel.SetActive(!m_creditsPanel.activeSelf); if (m_creditsPanel.activeSelf) { FXManager.Get().SetMusic("music/Ending Credits Music V.3"); } else { FXManager.Get().SetMusic("music/Main Title Theme V.2"); } }
void Awake() { myPhotonView = this.GetComponent<PhotonView>(); myHealth = this.GetComponent<Health>(); myHealth.currentHealth = maxHealth; fxManager = GameObject.FindObjectOfType<FXManager>(); fxManagerPhotonView = fxManager.GetComponent<PhotonView>(); netMan = GameObject.FindObjectOfType<NetMan>(); netManPhotonView = netMan.GetComponent<PhotonView>(); myMovement = this.GetComponent<KnightMovement>(); }
void CacheComponents() { if(anim == null) { anim = GetComponent<Animator>(); if(anim == null) { Debug.LogError ("ZOMG, you forgot to put an Animator component on this character prefab!"); } cc = GetComponent<CharacterController>(); if(cc == null) { Debug.LogError("No character controller!"); } fxManager = GameObject.FindObjectOfType<FXManager>(); if(fxManager == null) { Debug.LogError("Couldn't find an FXManager."); } } // Cache more components here if required! }
private void Initialize() { Inst = this; //Initializing CsDebug CsDebug debug = GetComponent<CsDebug>(); debug.Initialize(); //Initializing DBManager DBManager = new DBManager(); DBManager.Initialize(); //Initializing Event Manager EventManager = new EventManager(); EventManager.Initialize(); //Initializing NPC Manager NPCManager = new NPCManager(); NPCManager.Initialize(); //SelectedPC = GameObject.Find("HumanCharacter").GetComponent<HumanCharacter>(); //SelectedPC.Initialize(); PlayerControl = new PlayerControl(); PlayerControl.Initialize(); GameObject.Find("HumanCharacter2").GetComponent<HumanCharacter>().Initialize(); //GameObject.Find("HumanCharacter3").GetComponent<HumanCharacter>().Initialize(); CameraController = GameObject.Find("CameraController").GetComponent<CameraController>(); CameraController.Initialize(); FXManager = new FXManager(); FXManager.Initialize(50); AIScheduler = new AIScheduler(); AIScheduler.Initialize(); StartCoroutine(DoPerSecond()); }
// Use this for initialization void Start() { //impacts = new GameObject[maxImpacts]; //for(int i = 0; i < maxImpacts; i++){ //impacts[i] = Instantiate (impactPrefab) as GameObject; //} anim = GetComponentInChildren<Animator>(); fx = GameObject.FindObjectOfType<FXManager>(); if(fx == null) Debug.LogError("No FXManager!"); }
void Awake() { if(mInst == null) mInst = this; }
void Start() { fxManager = GameObject.FindObjectOfType<FXManager>(); if(fxManager == null) { Debug.LogError("Couldn't find an FXManager."); } hitmarker = GameObject.Find("Hitmarker"); if (weaponData == null) { weaponData = gameObject.GetComponentInChildren<WeaponData>(); if (weaponData == null) { Debug.LogError("Did not find any WeaponData in our children!"); return; } } }
void Start() { _instance = this; }
void Start() { this.speed = 0.015f; this.canMove = true; this.isSit = false; gameStart = false; this.animator = GetComponent<Animator> (); fxManager = GameObject.Find ("FXManager").GetComponent<FXManager> (); StartCoroutine (Instructions ()); StartCoroutine (GameStart ()); }
void Start() { Debug.Log("start GunController"); fxManager = FXManager.instance; cam = gameObject.transform.FindChild("PlayerCamera").gameObject; }
void Start() { anim = GetComponent<Animator> (); fxManager = GameObject.FindObjectOfType<FXManager> (); if (fxManager == null) { Debug.LogError ("Couldn't find an FXManager"); } }
protected void Awake() { controller = this.GetComponent<CharacterController2D>(); myPhotonView = this.GetComponent<PhotonView>(); myHealth = this.GetComponent<Health>(); moveState = moveStates.secondJump; fxManager = GameObject.FindObjectOfType<FXManager>(); if(fxManager) { fxManagerPhotonView = fxManager.GetComponent<PhotonView>(); } netMan = GameObject.FindObjectOfType<MovementTestingNetMan>(); netManPhotonView = netMan.GetComponent<PhotonView>(); }
private void Initialize() { Inst = this; //Initializing CsDebug CsDebug debug = GetComponent<CsDebug>(); debug.Initialize(); //Initializing DBManager DBManager = new DBManager(); DBManager.Initialize(); //Initializing Event Manager EventManager = new EventManager(); EventManager.Initialize(); ItemManager = new ItemManager(); ItemManager.Initialize(); //Initializing NPC Manager NPCManager = new NPCManager(); NPCManager.Initialize(); PlayerControl = new PlayerControl(); PlayerControl.Initialize(); UIManager = new UIManager(); UIManager.Initialize(); MutantCharacter mutant1 = GameObject.Find("MutantCharacter").GetComponent<MutantCharacter>(); mutant1.Initialize(); mutant1.MyStatus.MaxHealth = 200; mutant1.MyStatus.Health = 200; mutant1.MyAI.BlackBoard.PatrolLoc = new Vector3(70, 0, -54); mutant1.MyAI.BlackBoard.PatrolRange = new Vector3(10, 5, 10); mutant1.MyAI.BlackBoard.CombatRange = new Vector3(20, 5, 20); mutant1.MyAI.BlackBoard.HasPatrolInfo = true; //HumanCharacter enemy1 = GameObject.Find("HumanCharacter2").GetComponent<HumanCharacter>(); HumanCharacter enemy2 = GameObject.Find("HumanCharacter4").GetComponent<HumanCharacter>(); //HumanCharacter enemy3 = GameObject.Find("HumanCharacter5").GetComponent<HumanCharacter>(); //HumanCharacter enemy4 = GameObject.Find("HumanCharacter6").GetComponent<HumanCharacter>(); AISquad enemySquad = new AISquad(); //enemySquad.Members.Add(enemy1); enemySquad.Members.Add(enemy2); //enemySquad.Members.Add(enemy3); //enemySquad.Members.Add(enemy4); /* enemy1.Initialize(); enemy1.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy1.Inventory); enemy1.MyAI.WeaponSystem.LoadWeaponsFromInventory(); */ enemy2.Initialize(); enemy2.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy2.Inventory); enemy2.MyAI.WeaponSystem.LoadWeaponsFromInventory(); /* enemy3.Initialize(); enemy3.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy3.Inventory); enemy3.MyAI.WeaponSystem.LoadWeaponsFromInventory(); enemy4.Initialize(); enemy4.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy4.Inventory); enemy4.MyAI.WeaponSystem.LoadWeaponsFromInventory(); */ //enemy1.MyStatus.MaxHealth = 160; //enemy1.MyStatus.Health = 160; enemy2.MyStatus.MaxHealth = 100; enemy2.MyStatus.Health = 100; /* enemy3.MyStatus.MaxHealth = 80; enemy3.MyStatus.Health = 80; enemy4.MyStatus.MaxHealth = 100; enemy4.MyStatus.Health = 100; */ enemySquad.IssueSquadCommand(); CameraController = GameObject.Find("CameraController").GetComponent<CameraController>(); CameraController.Initialize(); CameraShaker = CameraController.GetComponent<CameraShaker>(); CameraShaker.Initialize(); FXManager = new FXManager(); FXManager.Initialize(50); AIScheduler = new AIScheduler(); AIScheduler.Initialize(); CursorManager = new CursorManager(); CursorManager.Initialize(); StartCoroutine(DoPerSecond()); StartCoroutine(DoPerHalfSecond()); }
// Use this for initialization void Start() { fxManager = FXManager.instance; Debug.Log("start GunController"); }
void Awake () { Instance = this; }
void Start() { this.target = this.gameObject; this.fxManager = GameObject.Find ("FXManager").GetComponent<FXManager> (); this.Request (); }
void Start() { fxManager = FXManager.instance; }
void Start() { fxManager = GameObject.FindObjectOfType<FXManager>(); if (fxManager != null) { fxManagerPV = fxManager.GetComponent<PhotonView>(); } if (fxManager == null) { Debug.LogError("could not find a FXManager"); } wd = gameObject.GetComponentInChildren<WeaponData>(); if (wd == null) { Debug.LogError("could not find WeaponData component!"); } }