예제 #1
0
    public bool Call(string eventName, IgorEventSystemS caller)
    {
        int index = Array.FindIndex(eventsList, s => eventName == s);

        if (index >= 0)
        {
            EventInfoS e = new EventInfoS(this, caller, index);
            if (events[index] != null)
            {
                events[index](e);
            }
            return(true);
        }
        return(false);
    }
예제 #2
0
    void Init()
    {
        state = States.NotInitialized;

        mic         = GetComponent <Sounder>();
        eventSystem = GetComponent <IgorEventSystemS>();

        _newSound = true;

        audioSource = GetComponent <AudioSource>();
        audioSource.Play();
        if (!audioSource.isPlaying)
        {
            Debug.Log("Not playing");
        }
        audioSource             = gameObject.AddComponent <AudioSource>();
        audioSource.playOnAwake = false;
        audioSource.loop        = false;
        audioSource.volume      = 0.5f;

        string[] controllers = Input.GetJoystickNames();
        if (controllers.Length > 0)
        {
            playerControl = new Pad();
            Debug.Log("Pad connected!");
        }
        else
        {
            playerControl = new Keyboard();
            Debug.Log("Keybard Connected");
        }

        lastTimePlayedDroplets = 0f;
        player = GameObject.Find("Player").GetComponent <Player>();
        points = 0;
        Text[] tempTab = GetComponentsInChildren <Text>();
        foreach (Text t in tempTab)
        {
            if (t.gameObject.name == "Score")
            {
                pointsText = t;
            }
        }
        pointsText.text = "0";
        endScreen       = GetComponentInChildren <EndScreen>();
        endScreen.gameObject.SetActive(false);
        state = States.GameInitialized;
    }
예제 #3
0
    void Init()
    {
        mainCamera       = Camera.main.gameObject;
        cameraManager    = mainCamera.GetComponent <CameraManager>();
        state            = States.NotInitialized;
        eventSystem      = GetComponent <IgorEventSystemS>();
        queue            = queueReference.GetComponent <Queue>();
        occurenceManager = occurenceReference.GetComponent <OccurenceManager>();
        player           = playerReference.GetComponent <Player>();
        foreach (string s in eventSystem.eventsList)
        {
            eventSystem.Subscribe(s, DefaultEvent);
        }


        audioSource = GetComponent <AudioSource>();
        audioSource.Play();
        if (!audioSource.isPlaying)
        {
            Debug.Log("Not playing");
        }
        audioSource             = gameObject.AddComponent <AudioSource>();
        audioSource.playOnAwake = false;
        audioSource.loop        = false;
        audioSource.volume      = 0.5f;

        lastTimePlayed = new float[audios.Length];
        for (int i = 0; i < lastTimePlayed.Length; i++)
        {
            lastTimePlayed[i] = Time.time;
        }


        occurenceManager.Init();
        queue.Init();
        player.Init();

        state = States.GameManagerReady;
    }
예제 #4
0
 public EventInfoS(IgorEventSystemS _send, IgorEventSystemS _call, int _id)
 {
     eventId = _id;
     sender  = _send;
 }
예제 #5
0
 public bool Call(string eventName, IgorEventSystemS caller)
 {
 }
예제 #6
0
 public EventInfoS(IgorEventSystemS _send, IgorEventSystemS _call, int _id)
 {
 }