Esempio n. 1
0
 void Awake()
 {
     thisTransform = transform;
     thisRigidbody = rigidbody;
     GOsoundEmitt = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesPeeble")) as GameObject;
     soundEmitt = GOsoundEmitt.GetComponent<WaveCreator>();
     soundEmitt.gameObject.name = "_pebbleWave";
     soundEmitt.gameObject.transform.parent = GameObject.Find("Level/Waves/").transform;
     //soundEmitt = Instantiate(instWave) as WaveCreator;
     soundEmitt.createCircle(thisTransform);
     soundEmitt.setParent(thisTransform);
     _CollisionSound = GameObject.Find("Player/SFX_Pebble").GetComponent<FESound>();
     if (_CollisionSound == null)
     {
         Debug.LogError ("Error to find player, plz fix");
     }
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesDrop")) as GameObject;
        soundEmitt1 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt1.gameObject.name = "_dropWave1"+ID;//footsteps wave 1
        soundEmitt1.gameObject.transform.parent = GameObject.Find("Level/Waves/").transform;
        soundEmitt1.createCircle(transform);soundEmitt1.setParent(transform);
        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesDrop")) as GameObject;
        soundEmitt2 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt2.gameObject.name = "_dropWave2"+ID;//footsteps wave 2
        soundEmitt2.gameObject.transform.parent = GameObject.Find("Level/Waves/").transform;
        soundEmitt2.createCircle(transform);soundEmitt2.setParent(transform);

        DropMask = gameObject.transform.FindChild("SoundWaveEltMask").gameObject as GameObject;

        spawnPos = transform.position;
        vectorMove = new Vector2(0f, -fallSpeed);
        DropEmitter.renderer.enabled = DropMask.renderer.enabled = false;
        StartCoroutine("waitB4Start");
    }
Esempio n. 3
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();

        GameEventManager.GameStart += GameStart;
        GameEventManager.GameOver += GameOver;
        GameEventManager.GamePause += GamePause;
        GameEventManager.GameUnpause += GameUnpause;

        spawnPos = transform.position;

        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesEmitter")) as GameObject;
        soundEmitt1 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt1.gameObject.name = "_footWaveRusher1";//footsteps wave 1
        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesEmitter")) as GameObject;
        soundEmitt2 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt2.gameObject.name = "_footWaveRusher2";//footsteps wave 2
        GOinstInstruWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesInstru")) as GameObject;
        soundInstru1 = GOinstInstruWave.GetComponent<WaveCreator>();soundInstru1.gameObject.name = "_instruWaveRusher1"; //intru wave 1

        soundEmitt1.gameObject.transform.parent = soundEmitt2.gameObject.transform.parent = soundInstru1.gameObject.transform.parent = GameObject.Find("Level/Waves/").transform;
        //		soundEmitt1 = Instantiate(instFootWave) as WaveCreator;
        //		soundEmitt2 = Instantiate(instFootWave) as WaveCreator;
        //		soundInstru1 = Instantiate(instInstruWave) as WaveCreator;
        soundEmitt1.createCircle(thisTransform);soundEmitt1.setParent(thisTransform);
        soundEmitt2.createCircle(thisTransform);soundEmitt2.setParent(thisTransform);
        soundInstru1.createCircle(thisTransform);soundInstru1.specialCircle();soundInstru1.setParent(thisTransform);

        //enabled = false;

        runSpeed = 0.5f;

        IdleSound.playDistancedSound("idle");

        setTarget(transform); //target reset
        patroling = true;
        waypointDetectionWidth = thisTransform.gameObject.GetComponentInChildren<Transform>().GetComponentInChildren<OTSprite>().transform.localScale.x/4;//transform.localScale.x/4;
    }
Esempio n. 4
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();

        GameEventManager.GameStart += GameStart;
        GameEventManager.GameOver += GameOver;
        GameEventManager.GamePause += GamePause;
        GameEventManager.GameUnpause += GameUnpause;

        spawnPos = thisTransform.position;

        if (WalkSound != null)
        {
            InvokeRepeating("playFootstepLeft",0f,WalkSound.RepeatRate);
            InvokeRepeating("playFootstepRight",WalkSound.Delay,WalkSound.RepeatRate);
            InvokeRepeating("playRunstepLeft",0f,RunSound.RepeatRate);
            InvokeRepeating("playRunstepRight",WalkSound.Delay,RunSound.RepeatRate);
        }

        //Creating waves game objects
        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesEmitter")) as GameObject; //footsteps wave 1
        soundEmitt1 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt1.gameObject.name = "_footWavePlayer1";
        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesEmitter")) as GameObject; //footsteps wave 2
        soundEmitt2 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt2.gameObject.name = "_footWavePlayer2";
        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesEmitter")) as GameObject; //footsteps wave 3
        soundEmitt3 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt3.gameObject.name = "_footWavePlayer3";
        GOinstInstruWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesInstru")) as GameObject; //intru wave 1
        soundInstru1 = GOinstInstruWave.GetComponent<WaveCreator>();soundInstru1.gameObject.name = "_instruWavePlayer1";
        GOinstInstruWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesInstru")) as GameObject; //instru wave 2
        soundInstru2 = GOinstInstruWave.GetComponent<WaveCreator>();soundInstru2.gameObject.name = "_instruWavePlayer2";

        soundEmitt1.gameObject.transform.parent = soundEmitt2.gameObject.transform.parent = soundEmitt3.gameObject.transform.parent =
            soundInstru1.gameObject.transform.parent = soundInstru2.gameObject.transform.parent = GameObject.Find("Level/Waves/").transform;

        soundEmitt1.createCircle(thisTransform);soundEmitt1.setParent(thisTransform); //creating wave elements of FOOT wave 1
        soundEmitt2.createCircle(thisTransform);soundEmitt2.setParent(thisTransform); //creating wave elements of FOOT wave 2
        soundEmitt3.createCircle(thisTransform);soundEmitt3.setParent(thisTransform); //creating wave elements of FOOT wave 3
        soundInstru1.createCircle(thisTransform);soundInstru1.specialCircle();soundInstru1.setParent(thisTransform); //creating wave elements of INSTRU wave 1 & setting waves params to INSTRU
        soundInstru2.createCircle(thisTransform);soundInstru2.specialCircle();soundInstru2.setParent(thisTransform); //creating wave elements of INSTRU wave 2 & setting waves params to INSTRU

        pebbleBar = Instantiate(Resources.Load("Prefabs/04Gameplay/PebbleBar")) as GameObject; //Create UI power bar
        footStepDelayINI = footStepDelay;
    }
Esempio n. 5
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();

        GameEventManager.GameStart += GameStart;
        GameEventManager.GameOver += GameOver;
        GameEventManager.GamePause += GamePause;
        GameEventManager.GameUnpause += GameUnpause;

        spawnPos = transform.position;

        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesEmitter")) as GameObject;
        soundEmitt1 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt1.gameObject.name = "_footWaveWalker1";//footsteps wave 1
        GOinstFootWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesEmitter")) as GameObject;
        soundEmitt2 = GOinstFootWave.GetComponent<WaveCreator>();soundEmitt2.gameObject.name = "_footWaveWalker2";//footsteps wave 2
        GOinstInstruWave = Instantiate(Resources.Load("Prefabs/04Gameplay/SoundWavesInstru")) as GameObject;
        soundInstru1 = GOinstInstruWave.GetComponent<WaveCreator>();soundInstru1.gameObject.name = "_instruWaveWalker1"; //intru wave 1

        soundEmitt1.gameObject.transform.parent = soundEmitt2.gameObject.transform.parent = soundInstru1.gameObject.transform.parent = GameObject.Find("Level/Waves/").transform;

        if (WalkSound != null)
        {
            InvokeRepeating("playFootstep",0f,WalkSound.RepeatRate);
        }

        //		soundEmitt1 = Instantiate(instFootWave) as WaveCreator;
        //		soundEmitt2 = Instantiate(instFootWave) as WaveCreator;
        //		soundInstru1 = Instantiate(instInstruWave) as WaveCreator;
        soundEmitt1.createCircle(thisTransform);soundEmitt1.setParent(thisTransform);
        soundEmitt2.createCircle(thisTransform);soundEmitt2.setParent(thisTransform);
        soundInstru1.createCircle(thisTransform);soundInstru1.specialCircle();soundInstru1.setParent(thisTransform);
        //pebble1.setCallerObject(thisTransform);
        //enabled = false;
        runSpeed = 0.5f;

        bxTail = gameObject.AddComponent<BoxCollider>();
        bxTail.center = new Vector3(0f,0f,0f);
        bxTail.size = new Vector3(0.5f,0.5f, 30f);

        setTarget(transform); //target
        patroling = true;
        waypointDetectionWidth = thisTransform.gameObject.GetComponentInChildren<Transform>().GetComponentInChildren<OTSprite>().transform.localScale.x/4;//transform.localScale.x;
        StartCoroutine("goToWaypoint",waypointId);
    }