private IEnumerator SetInvincibility(byte duration) { CurrentPlayerEffect = SpecialEffects.Invincibility; yield return(new WaitForSeconds(duration)); CurrentPlayerEffect = SpecialEffects.NoEffect; }
private void SetEffect(string effect, DirectionTarget facing, Level inLevel, TrashCan who) { // Display Small Spark Effect on Hit SpecialEffects spark = new SpecialEffects(effect, facing, inLevel, who); InLevel.GameItems.Add(spark); }
private void SetEffect(string effect, Actor who, RolentoEnemy p) { // Display Small Spark Effect on Hit SpecialEffects spark = new SpecialEffects(effect, who.Position, InLevel, p); InLevel.GameItems.Add(spark); }
private static SpecialEffects Get() { if (singletonInstance == null) { singletonInstance = FindObjectsOfType <SpecialEffects>()[0]; } return(singletonInstance); }
// Use this for initialization void Start() { maxHp = hp; healthBar = GameObject.FindWithTag("Healthbar").GetComponent <Slider>(); gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>(); effects = GameObject.FindWithTag("Script").GetComponent <SpecialEffects>(); soundEffects = GameObject.FindWithTag("Script").GetComponent <SoundEffects>(); lastDmgTaken = 0; }
void Awake() { if (Instance != null) { Debug.LogError("Multiple instances of SpecialEffectsHelper!"); } Instance = this; }
void Awake() { // Register the singleton if (Instance != null) { Debug.LogError("Multiple instances of SpecialEffectsHelper!"); } Instance = this; }
public void ProcessEquipLineTest() { for (int m_i = 0; m_i < 13; m_i++) { string line = m_TestLineArray[m_i]; Stats stats = new Stats(); bool isArmory = false; SpecialEffects.ProcessEquipLine(line, stats, isArmory, 0, 0); string szExpected = m_ExpectedArray[m_i].ToString(); string szStats = stats.ToString(); Assert.AreEqual(szExpected, szStats, line); } }
public void SpawnGroundParticle() { isGroundWithParticle = _rays.IsCrossed(0); if (isGroundWithParticle) { _specialEffects = _rays.GetCrossInformaiton(0).collider.GetComponent <SpecialEffects>(); if (_specialEffects == true) { Instantiate(_specialEffects.landParticles, particlePosition); } } }
public void PlayLandSound() { isGroundWithParticle = _rays.IsCrossed(0); if (isGroundWithParticle) { _specialEffects = _rays.GetCrossInformaiton(0).collider.GetComponent <SpecialEffects>(); if (_specialEffects == true) { audioSorce.pitch = Random.Range(0.7f, 1.4f); audioSorce.PlayOneShot(_specialEffects.landSound); } } }
public void PlayJumpSound() { isGroundWithParticle = _rays.IsCrossed(0); if (isGroundWithParticle) { _specialEffects = _rays.GetCrossInformaiton(0).collider.GetComponent <SpecialEffects>(); if (_specialEffects == true) { audioSorce.pitch = 0.9f; audioSorce.PlayOneShot(_specialEffects.jumpSound); } } }
void Start() { GameObject.FindGameObjectWithTag("persistentObject").GetComponent <CreateAndDestroyAppointment>().OnAppointmentStarted(); usedSeed = SeedTheLevel(); // spawn appropriate number of people and add them to the allPeople list allPeople.AddRange(SpawnPeople(currentLevelInfo.level)); InitiateLevel(); SaveStartingState(); // generate random order of faces int numFaces = GetAllPeople()[0].faces_normal.Count; List <int> sequentialList = new List <int>(); for (int i = 0; i <= numFaces; i++) { sequentialList.Add(i); } List <int> randomList = new List <int>(); for (int i = numFaces; i >= 0; i--) { int n = Random.Range(0, i); randomList.Add(sequentialList[n]); sequentialList.RemoveAt(n); } foreach (Person _person in GetAllPeople()) { _person.Initialize(randomList[0]); randomList.RemoveAt(0); } selectionCursorInst = Instantiate(selectionCursor) as GameObject; selectionCursorInst.GetComponent <Renderer>().enabled = false; selectionCursorInst.transform.parent = transform; cursorSecondaryInst = Instantiate ( cursorSecondary, new Vector3 ( selectionCursorInst.transform.position.x, selectionCursorInst.transform.position.y, selectionCursorInst.transform.position.z + 1.5f ), Quaternion.identity ) as GameObject; cursorSecondaryInst.GetComponent <Renderer>().enabled = false; cursorSecondaryInst.transform.parent = selectionCursorInst.transform; myAudioComponent = gameObject.GetComponent <AudioSource>() as AudioSource; if (SaveGame.GetAudioOn_sfx()) { isAudioOn_sfx = true; } else { isAudioOn_sfx = false; } // set restart button position (to the left of the audio icons) Vector3 MusicButtonPos = GameObject.Find("audioToggle_music").transform.position; Vector3 SFXButtonPos = GameObject.Find("audioToggle_sfx").transform.position; float difference = Vector3.Distance(MusicButtonPos, SFXButtonPos); GameObject restartLevelButton = GameObject.Find("restartLevel"); if (restartLevelButton != null) { restartLevelButton.transform.position = new Vector3(MusicButtonPos.x - difference, MusicButtonPos.y, MusicButtonPos.z); } specialEffects = GetComponent <SpecialEffects>(); // reset seed back to something random Random.seed = (int)System.DateTime.Now.Second; textBubble = GetComponent <TextBubble>(); textBubble.Init(allPeople); #if UNITY_WEBPLAYER GameObject.Find("redAndGreenButtons").GetComponent <Renderer>().material = redAndGreenButton_keys; #endif }
void Destroy() { Instance = null; }
void Awake() { Instance = this; specialEffectParent = new GameObject("Special effects").transform; }
public void AddSpecialEffect(SpecialEffect effect) { SpecialEffects.Add(effect); effect.AddTarget(this); }
void Awake() { instance = this; }
// TODO: add UI or audio feedback for a sale happening. // This is called from BusinessSystem public void ShowSale(PotionType PotionType) { int amount = GameData.singleton.potionPrices[(int)PotionType]; SpecialEffects.ShowNumberChange(GetPotionGroup(PotionType), amount, Color.yellow); }
void Awake() { instance = this; }
// Update is called once per frame void Update() { // Tap effect // Checks for all fingers for (int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); // A tap is a quick touch and release if (touch.phase == TouchPhase.Ended && touch.tapCount == 1) { // Touches are screen locations, this converts them in to world locations Vector3 position = Camera.main.ScreenToWorldPoint(touch.position); // Creates the Explosion Effect SpecialEffects.MakeExplosion((position)); } else { // Controls for the Swipe Gesture if (touch.phase == TouchPhase.Began) { // Store this new value if (trails.ContainsKey(i) == false) { // Touches are screen locations, this converts them in to world locations Vector3 position = Camera.main.ScreenToWorldPoint(touch.position); // Ensures the trail is visible position.z = 0; // Creates the Trails Effect GameObject trail = SpecialEffects.MakeTrail(position); // If the trail is still enabled if (trail != null) { // Log the trail Debug.Log(trail); // Add some more Trails trails.Add(i, trail); } } } else if (touch.phase == TouchPhase.Moved) { // Moves the trail if (trails.ContainsKey(i)) { // Array for the Trails GameObject trail = trails[i]; // Converts touches in to world locations Camera.main.ScreenToWorldPoint(touch.position); Vector3 position = Camera.main.ScreenToWorldPoint(touch.position); // Ensures trail is visible position.z = 0; // Sets position of the trails to position of the finger trail.transform.position = position; } } else if (touch.phase == TouchPhase.Ended) { // Clears all visible trails if (trails.ContainsKey(i)) { GameObject trail = trails[i]; // Fades trails out Destroy(trail, trail.GetComponent <TrailRenderer>().time); trails.Remove(i); } } } } }
public bool IsSpecial(out SpecialEffects function) { function = SpecialEffects.None; return(false); }
void Start() { GameObject.FindGameObjectWithTag("persistentObject").GetComponent<CreateAndDestroyAppointment>().OnAppointmentStarted(); usedSeed = SeedTheLevel(); // spawn appropriate number of people and add them to the allPeople list allPeople.AddRange(SpawnPeople(currentLevelInfo.level)); InitiateLevel(); SaveStartingState(); // generate random order of faces int numFaces = GetAllPeople()[0].faces_normal.Count; List<int> sequentialList = new List<int>(); for (int i = 0; i <= numFaces; i++) { sequentialList.Add(i); } List<int> randomList = new List<int>(); for (int i = numFaces; i >= 0; i--) { int n = Random.Range(0, i); randomList.Add(sequentialList[n]); sequentialList.RemoveAt(n); } foreach (Person _person in GetAllPeople()) { _person.Initialize(randomList[0]); randomList.RemoveAt(0); } selectionCursorInst = Instantiate(selectionCursor) as GameObject; selectionCursorInst.GetComponent<Renderer>().enabled = false; selectionCursorInst.transform.parent = transform; cursorSecondaryInst = Instantiate ( cursorSecondary, new Vector3 ( selectionCursorInst.transform.position.x, selectionCursorInst.transform.position.y, selectionCursorInst.transform.position.z + 1.5f ), Quaternion.identity ) as GameObject; cursorSecondaryInst.GetComponent<Renderer>().enabled = false; cursorSecondaryInst.transform.parent = selectionCursorInst.transform; myAudioComponent = gameObject.GetComponent<AudioSource>() as AudioSource; if (SaveGame.GetAudioOn_sfx()) { isAudioOn_sfx = true; } else { isAudioOn_sfx = false; } // set restart button position (to the left of the audio icons) Vector3 MusicButtonPos = GameObject.Find("audioToggle_music").transform.position; Vector3 SFXButtonPos = GameObject.Find("audioToggle_sfx").transform.position; float difference = Vector3.Distance(MusicButtonPos, SFXButtonPos); GameObject restartLevelButton = GameObject.Find("restartLevel"); if (restartLevelButton != null) { restartLevelButton.transform.position = new Vector3(MusicButtonPos.x - difference, MusicButtonPos.y, MusicButtonPos.z); } specialEffects = GetComponent<SpecialEffects>(); // reset seed back to something random Random.seed = (int)System.DateTime.Now.Second; textBubble = GetComponent<TextBubble>(); textBubble.Init(allPeople); #if UNITY_WEBPLAYER GameObject.Find("redAndGreenButtons").GetComponent<Renderer>().material = redAndGreenButton_keys; #endif }
void Awake() { // Assigning the value of instance to this script instance = this; }
public bool IsSpecial(out SpecialEffects function) { function = SpecialEffects.None; return false; }
void Start() { if(instance == null) { instance = this; } else { Destroy(this); } }