示例#1
0
    public void Initialize(SoundFXManager SoundFXManager)
    {
        this.SoundFXManager = SoundFXManager;
        soundDictionary     = new Dictionary <string, Sound>(sounds.Length);
        if (audioSource != null && mixerGroup != null)
        {
            audioSource.outputAudioMixerGroup = mixerGroup;
        }

        foreach (Sound sound in sounds)
        {
            if (audioSource != null)
            {
                sound.audioSource = audioSource;
            }
            else if (sound.audioSource == null)
            {
                sound.audioSource = SoundFXManager.gameObject.AddComponent <AudioSource>();
                sound.audioSource.outputAudioMixerGroup = mixerGroup;
                sound.audioSource.clip = sound.AudioClip;
            }
            if (!soundDictionary.ContainsKey(sound.Name))
            {
                soundDictionary.Add(sound.Name, sound);
            }
            else
            {
                Debug.LogError("Error: You can not have two sounds with the same name.");
            }
        }
    }
示例#2
0
 // Use this for initialization
 void Start()
 {
     player         = GetComponent <Player>();
     animator       = gameObject.GetComponent <Animator>();
     effectshandler = GameObject.Find("Effects Handler");
     soundFX        = GameObject.Find("SoundFX Manager").GetComponent <SoundFXManager>();
 }
示例#3
0
    public void SetUp(int v, int t, SoundFXManager sm)
    {
        Debug.Log(TAG + "setting up.");
        soundManager = sm;

        //is a fal safe making sure an incorrect color isn't inputed
        val = tool.SetUp(v, this, sm);


        if (val == 8)
        {
            rend.material = rainbowMat;
        }
        else
        {
            rend.material = normMat;
        }
        UpdateColor();
        glowEffect.Stop();
        var main = glowEffect.main;

        main.startColor = Calc.GetColor(val);

        //delay entry
        toolNum        = t;
        timer          = 1.8f + toolNum * 0.3f;
        animator.speed = 0.0f;
        paused         = true;
        tool.gameObject.SetActive(false);
    }
示例#4
0
	// Use this for initialization
	void Start () 
	{
		manager = transform.parent.gameObject.GetComponent<ArrowManager>();
		soundFX = GameObject.Find("SoundMistro").GetComponent<SoundFXManager>();
		renderer.enabled = false;
		collider.enabled = false;
	}
	void Awake() {
		if (Instance == null) {
			Instance = this;
			audioSource = GetComponent<AudioSource>();
		}
		else {
			Destroy (gameObject);
		}
	}
示例#6
0
    // Start is called before the first frame update
    void Start()
    {
        main       = GameObject.Find("Main");
        sfx        = FindObjectOfType(typeof(SoundFXManager)) as SoundFXManager;
        scoreValue = (int)health;

        transform.Rotate(new Vector3(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f), 0));
        GetComponent <Rigidbody>().velocity        = new Vector3(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f), 0);
        GetComponent <Rigidbody>().angularVelocity = new Vector2(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f));
    }
	void Start () 
	{
		guitext = gameObject.GetComponent<GUIText>();
		soundFX = GameObject.Find("SoundMistro").GetComponent<SoundFXManager>();
		totalScoreText = GameObject.Find ("Score").GetComponent<UILabel> ();

		//this fixes the fonts to be consistant
		fontRatio = Screen.height/1280.0f;
		FONT_SIZE *= fontRatio;
		addFontAmount *= fontRatio;
	}
示例#8
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
     }
 }
示例#9
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
示例#10
0
    public override int SetUp(int v, ButtonTool bt, SoundFXManager sm)
    {
        //make sure it is a primary color for all diamond and cube type tools

        if (v == 3 || v == 4 || v == 5)
        {
            Debug.Log("wrong value");
            val = 6;


            return(base.SetUp(val, bt, sm));
        }
        return(base.SetUp(v, bt, sm));
    }
示例#11
0
    void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Debug.LogError("Duplicate singleton " + this.gameObject + " created; destroying it now");
            Destroy(this.gameObject);
        }

        if (_instance != this)
        {
            _instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
    }
示例#12
0
    IEnumerator startCutsceneTrigger(string triggerToActivate)
    {
        //Que asco de codigo ;_v no merezco ni progamar xd
        CircleCollider2D sculptureCollider;
        MusicManager     musicManager = GameObject.Find("MusicManager").GetComponent <MusicManager>();

        musicManager.SpeedUpSong(0.2f);
        StairClimber playerMove = GameObject.Find("Restorer").GetComponent <StairClimber>();

        playerMove.stopMovement();
        if (estatua2.TryGetComponent <CircleCollider2D>(out sculptureCollider) || estatua1.TryGetComponent <CircleCollider2D>(out sculptureCollider))
        {
            SoundFXManager soundFXManager = GameObject.Find("SoundFXManager").GetComponent <SoundFXManager>();
            soundFXManager.StopPlayingAll();
            playerMove.canMove   = false;
            lapseTimer.isRunning = false;
        }
        estatua1.GetComponent <Animator>().SetTrigger(triggerToActivate);
        if (estatua1.TryGetComponent <CircleCollider2D>(out sculptureCollider))
        {
            cinemachine.Follow = estatua1.transform;
            yield return(new WaitForSeconds(3));
        }
        estatua2.GetComponent <Animator>().SetTrigger(triggerToActivate);
        if (estatua2.TryGetComponent <CircleCollider2D>(out sculptureCollider))
        {
            cinemachine.Follow = estatua2.transform;
            yield return(new WaitForSeconds(3));
        }

        if (estatua2.TryGetComponent <CircleCollider2D>(out sculptureCollider) || estatua1.TryGetComponent <CircleCollider2D>(out sculptureCollider))
        {
            cinemachine.Follow   = GameObject.Find("Restorer").transform;
            lapseTimer.isRunning = true;
            if (triggerToActivate.Equals("Deterioro4"))
            {
                Time.timeScale     = 0f;
                playerMove.canMove = false;
                endScreen.SetActive(true);
                musicManager.StopPlayingAll();
                musicManager.Play("MusicLost");
            }
            else
            {
                playerMove.canMove = true;
            }
        }
    }
示例#13
0
文件: Tool.cs 项目: Penjat/Colorgy
 public virtual int SetUp(int v, ButtonTool bt, SoundFXManager sm)
 {
     Debug.Log(TAG + "Setting up.");
     soundManager = sm;
     val          = v;
     if (v == 7)
     {
         //if the value passed is 7 (empty) just make it white
         val = 6;
     }
     buttonTool = bt;
     col        = Calc.GetColor(val);
     //rend = GetComponent<Renderer>();
     //UpdateColor();
     return(val);
 }
示例#14
0
 // Start is called before the first frame update
 void Start()
 {
     if (SaveAndLoad.LoadPlayer() != null)
     {
         currentHighestScore = SaveAndLoad.LoadPlayer().currentHightestScore;
     }
     else
     {
         currentHighestScore = 0;
     }
     sound       = FindObjectOfType <SoundFXManager>();
     PlayerScore = 0;
     rb2d        = GetComponent <Rigidbody2D>();
     FindObjectOfType <SoundFXManager>().Play("Bike");
     animator = GetComponent <Animator>();
     print(currentHighestScore);
     GameHandler.instance.UpdateHighestScoreText(currentHighestScore);
 }
示例#15
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        grabFX     = transform.Find("GrabFX").GetComponent <AudioSource>();
        clickFX    = transform.Find("ClickFX").GetComponent <AudioSource>();
        missFX     = transform.Find("MissFX").GetComponent <AudioSource>();
        teleportFX = transform.Find("TeleportFX").GetComponent <AudioSource>();
    }
示例#16
0
    // Use this for initialization
    void Start()
    {
        animator         = GetComponent <Animator>();
        player_2Animator = GetComponent <Animator>();
        player_1Animator = GetComponent <Animator>();
        playerAbilities  = gameObject.GetComponent <PlayerAbilities>();
        uiManager        = GameObject.Find("Canvas").GetComponent <UIManager>();
        soundFX          = GameObject.Find("SoundFX Manager").GetComponent <SoundFXManager>();
        gameManager      = GameObject.Find("GameManager").GetComponent <Game_Manager>();

        if (gameManager.isCoOpMode == false)
        {
            transform.position = new Vector3(0, 0, 0);
        }
        else if (gameManager.isCoOpMode == true)
        {
            //do nothing
        }
    }
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        foreach (Sound s in sounds)
        {
            s.source      = gameObject.AddComponent <AudioSource>();
            s.source.clip = s.clip;
            s.source.loop = s.loop;

            s.source.outputAudioMixerGroup = mixerGroup;
        }
    }
示例#18
0
 private void Awake()
 {
     //Maintain singleton instance
     if (instance == null)
     {
         instance = this;
     }
     //Ensure there is only one instance of the SoundFXManager
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     //Persist between scenes
     //DontDestroyOnLoad(gameObject);
     soundGroupDictionary = new Dictionary <string, SoundGroup>(soundGroups.Length);
     foreach (SoundGroup group in soundGroups)
     {
         soundGroupDictionary.Add(group.Name, group);
         group.Initialize(this);
     }
 }
示例#19
0
    public void LoadCredits(MenuManager mm, SoundFXManager sm)
    {
        menuManager  = mm;
        soundManager = sm;


        credits = new Credit[12];

        credits[0]  = new Credit("thank you for playing", 5.0f);
        credits[1]  = new Credit("Colorgy", 5.0f);
        credits[2]  = new Credit("game developed by", 5.0f);
        credits[3]  = new Credit("Spencer Symington", 5.0f);
        credits[4]  = new Credit("dedicated to \nAnjali", 5.0f);
        credits[5]  = new Credit("you are the best", 5.0f);
        credits[6]  = new Credit("thank you \nMom and Dad", 5.0f);
        credits[7]  = new Credit("and my sister \nSabrina", 5.0f);
        credits[8]  = new Credit("and to everyone else", 5.0f);
        credits[9]  = new Credit("Thank you for beliving in me", 5.0f);
        credits[10] = new Credit("this has been", 5.0f);
        credits[11] = new Credit("Colorgy", 5.0f);
    }
示例#20
0
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        foreach (Sound s in sounds)
        {
            s.source             = gameObject.AddComponent <AudioSource>();
            s.source.clip        = s.clip;
            s.source.volume      = s.volume;
            s.source.pitch       = s.pitch;
            s.source.loop        = s.loop;
            s.source.playOnAwake = s.playOnAwake;
        }
    }
    private void Start()
    {
        musicManager   = GameObject.FindObjectOfType <MusicManager>();
        soundFXManager = GameObject.FindObjectOfType <SoundFXManager>();
        motionBlur     = camera.GetComponent <MotionBlur>();
        depthOfField   = camera.GetComponent <DepthOfField>();
        SSAO           = camera.GetComponent <ScreenSpaceAmbientOcclusion>();
        noiseAndGrain  = camera.GetComponent <NoiseAndGrain>();
        bloom          = camera.GetComponent <Bloom>();
        antiAliasing   = camera.GetComponent <Antialiasing>();
        fpsCap         = GameObject.FindObjectOfType <FPS_Cap>();

        musicScrollbar.value          = PlayerPrefsManager.GetMusicVolume();
        soundFXScrollbar.value        = PlayerPrefsManager.GetSoundFXVolume();
        motionBlurScrollbar.value     = PlayerPrefsManager.GetMotionBlur();
        depthOfFieldScrollbar.value   = PlayerPrefsManager.GetDepthOfField();
        SSAOScrollbar.value           = PlayerPrefsManager.GetSSAO();
        noiseAndGrainToggle.isOn      = PlayerPrefsManager.GetNoiseAndGrain();
        bloomToggle.isOn              = PlayerPrefsManager.GetBloom();
        antiAliasingDropdown.value    = PlayerPrefsManager.GetAntiAliasing();
        targetFrameRateDropdown.value = PlayerPrefsManager.GetTargetFramerate();
    }
    protected override void CheckInput()
    {
        SoundFXManager sfxManager = GameObject.Find("SoundFXManager").GetComponent <SoundFXManager>();

        if (canMove)
        {
            base.CheckInput();
            if (isClimbing)
            {
                velocity.y = Input.GetAxisRaw(AxisName.Vertical.ToString()) * climbSpeed;
                animator.SetBool("Climbing", true);
            }
            else
            {
                animator.SetBool("Climbing", false);
            }
            if (velocity.x != 0)
            {
                if (!initSound)
                {
                    sfxManager.Play("Walk");
                    initSound = true;
                }
            }
            else
            {
                initSound = false;
                sfxManager.StopPlaying("Walk");
            }
            animator.SetBool(Lvl2PlayerAnimStates.Walking.ToString(), Input.GetButton(AxisName.Horizontal.ToString()));
        }
        else
        {
            velocity = Vector2.zero;
            sfxManager.StopPlaying("Walk");
        }
    }
	public void playFX(SoundFXManager.FXNames name)
	{
		fxSources[(int)name].Play();
	}
示例#24
0
    //=============================================================================
    // Fade out sfx and stops any looped clips
    //public void FadeSoundOut()
    //{
    //	if( PlayerManager.SoundOn )
    //	{
    //		isInTransition = true;
    //		transitionDir = -1;
    //		transitionVolume = 1.0f;
    //	}
    //}

    //=============================================================================

    //public void FadeSoundIn()
    //{
    //	if( PlayerManager.SoundOn )
    //	{
    //		isInTransition = true;
    //		transitionDir = 1;
    //		transitionVolume = 0.0f;
    //	}
    //}

    //=============================================================================

    void Awake()
    {
        instance = this;
    }
示例#25
0
 // Use this for initialization
 void Start()
 {
     powerUps = GetComponent <GameObject>();
     animator = GetComponent <Animator>();
     soundFX  = GameObject.Find("SoundFX Manager").GetComponent <SoundFXManager>();
 }
示例#26
0
文件: Engine.cs 项目: jpgdev/JPEngine
        private static void InitializeDefaultCore(IGraphicsDeviceService graphicsDeviceService)
        {
            if (graphicsDeviceService == null)
                throw new ArgumentNullException("graphicsDeviceService");

            //TODO: Remove this or make a way to remove it if it is not used (ContentManager)
            ////////////////////////////////////////////////////////////////
            var services = new GameServiceContainer();
            services.AddService(typeof (IGraphicsDeviceService), graphicsDeviceService);

            //TODO: Enable the user to change the RootDirectory
            _contentManager = new ContentManager(services, "Content");
            ///////////////////////////////////////////////////

            SpriteRenderer = new SpriteBatchRenderer(Window.GraphicsDevice);
            Entities = new EntitiesManager();
            Settings = new SettingsManager();
            Input = new InputManager();
            Cameras = new CameraManager();
            Music = new MusicManager(_contentManager);
            SoundFX = new SoundFXManager(_contentManager);
            Textures = new TextureManager(_contentManager);
            Fonts = new FontsManager(_contentManager);

            InitializeManagers();
        }
示例#27
0
 // Use this for initialization
 void Start()
 {
     uiManager = GameObject.Find("Canvas").GetComponent <UIManager>();
     soundFX   = GameObject.Find("SoundFX Manager").GetComponent <SoundFXManager>();
 }