Ejemplo n.º 1
0
 protected void OnDestroy()
 {
     if (singleton == this)
     {
         singleton = null;
     }
 }
Ejemplo n.º 2
0
    void RemoveButton()
    {
        Event_Manager.ClockWheel_Change(ClockWheelState.Stop);
        Button btn = Event_Manager.Get_Button();

        btn.onClick.RemoveAllListeners();
    }
Ejemplo n.º 3
0
 void CoolDown()
 {
     Game_Manager.instance.Malfunction = 1;
     Event_Manager.Malfunction_Set(false);
     Game_Manager.instance.ResetGravity();
     Game_Manager.instance.ResetSpeed();
     Event_Manager.Wheels_Operate();
 }
Ejemplo n.º 4
0
 private void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.GetComponent <Bullet_Benaviour>() && col.gameObject.GetComponent <Bullet_Benaviour>().TypeOfAmmo == Ammo_Types.Ammo.Extinguisher &&
         !Event_Manager.getEventStatus(0, 1) && !Event_Manager.fireFailed)
     {
         health--;
     }
 }
Ejemplo n.º 5
0
 void DoAnim()
 {
     Head = Event_Manager.Get_Head();
     RemoveButton();
     gameObject.GetComponent <Collider2D>().enabled = false;
     Head.transform.parent = EndPosition;
     Head.transform.DOMove(EndPosition.position, 3);
     StartCoroutine(OnGearAdded()); //start rotation after x seconds on the now connected gear
 }
Ejemplo n.º 6
0
 void OnTriggerEnter2D(Collider2D coll)
 {
     Debug.Log("col " + coll.gameObject.name);
     if (coll.gameObject.tag == "Player")
     {
         coll.gameObject.GetComponent <Platformer2DUserControl>().enabled = false;
         Event_Manager.Set_Head(Head);
         gameObject.GetComponent <Collider2D>().enabled = false;
     }
 }
Ejemplo n.º 7
0
 public IEnumerator TimerSpeed()
 {
     while (Speed < 1 && Malfunction == 1)
     {
         Debug.Log("Slowing");
         Game_Manager.instance.Speed      += 0.1f;
         Game_Manager.instance.WheelSpeed -= 0.25f;
         Event_Manager.Music_Change();
         yield return(new WaitForSeconds(1 * Speed));
     }
     // Debug.Log("Normalized");
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     if (_Instance == null)
     {
         _Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 9
0
    public Dictionary <string, Event> _worldEventsList; //unity internal event system, see how that works

    protected void Awake()
    {
        if (singleton == null)
        {
            singleton = this;
            DontDestroyOnLoad(singleton);
            init();
        }
        else
        {
            Destroy(this);
        }
    }
Ejemplo n.º 10
0
 void OnTriggerEnter2D(Collider2D coll)
 {
     //  Debug.Log("col " + coll.gameObject.name);
     if (coll.gameObject.tag == "Player")
     {
         Event_Manager.ClockWheel_Change(ClockWheelState.Start);
         Button btn = Event_Manager.Get_Button();
         if (!Triggered)
         {
             btn.onClick.AddListener(DoAnim);
             Triggered = true;
         }
     }
 }
Ejemplo n.º 11
0
    public void Rotate_Wheel(Time_States _ts)
    {
        switch (_ts)
        {
        case (Time_States.Speed):
            Game_Manager.instance.Speed      -= 0.1f;
            Game_Manager.instance.WheelSpeed += 0.25f;
            Event_Manager.Music_Change();
            break;

        case (Time_States.Gravity):
            Game_Manager.instance.Gravity      -= 0.1f;
            Game_Manager.instance.WheelGravity += 0.25f;
            break;
        }
    }
Ejemplo n.º 12
0
 private void OnCollisionStay(Collision other)
 {
     if (other.gameObject.name == "Player")
     {
         if (Event_Manager.isEventActive(1, 2))
         {
             if (Input.GetKeyDown(KeyCode.E))
             {
                 isActive = true;
             }
             else if (Input.GetKeyUp(KeyCode.E))
             {
                 timer = 0.0f;
             }
         }
     }
 }
Ejemplo n.º 13
0
 private void OnTriggerStay(Collider other)
 {
     if (other.gameObject.name == "Player")
     {
         Debug.Log("Bunker");
         if (Event_Manager.isEventActive(1, 2))
         {
             if (Input.GetKeyDown(KeyCode.E))
             {
                 isActive = true;
             }
             else if (Input.GetKeyUp(KeyCode.E))
             {
                 timer = 0.0f;
             }
         }
     }
 }
Ejemplo n.º 14
0
    void Start()
    {
        str_Event_Mag  = Event_Manager.Instance; //사용할때 변수 안쓰고 쓸라면 (Event_Manager.Instance).
        str_Camera_Mag = Camera_Manager.Instance;
        str_Character  = Character.Instance;
        str_ride_car   = ride_car.Instance;
        str_sound_Mag  = Sound_Manager.Instance;

        //타 클래스 초기화.
        str_Event_Mag.Event_Init();
        str_Character.Character_Init();
        str_ride_car.ride_car_Init();
        str_Camera_Mag.Camera_Init();

        eat_ice_cream = true;
        ice_cream     = false;
        trash_check   = false;
        car_check     = false;
        F_key_        = true;

        ride_car_update = false;
        ride_car_Evnet  = false;
        char_update     = true;
        trash_Event     = false;
        cross_Event     = false;
        steel_down      = false;

        shoot_       = false;
        trash_shoot_ = false;
        dir_con      = new Vector3(0, 0, 0);

        c_distance = .0f;
        t_distance = .0f;
        trash_dis  = 4.0f;

        spriteRenderer = GameObject.Find("Player_ice_cream").GetComponent <SpriteRenderer>();

        //오브젝트 위치 set
        obj_trash.transform.position = new Vector3(-5.66f, 3.94f, -1.0f);

        //background_bgm
        str_sound_Mag.PlayBGM(1);
    }
Ejemplo n.º 15
0
    private void OnCollisionStay(Collision collision)
    {
        if (collision.gameObject.name == "Player" && eventIsActive)
        {
            if (!isNew && Event_Manager.isEventActive(2, 2))
            {
                if (timer <= 10.0f && timer > 0.0f)
                {
                    timer       -= Time.deltaTime;
                    bPrompt.text = "Repair Time: " + timer.ToString()[0] + timer.ToString()[1] + timer.ToString()[2] + timer.ToString()[3] + "s";
                }
                else if (timer <= 0.0f)
                {
                    //Destroy(smokeSpawn);
                    //smokeSpawned = false;
                    timer        = 0.0f;
                    bPrompt.text = "";
                    Event_Manager.instance.gennyReplaced = true;
                }
            }
            else
            {
                if (!promptSpawned && !Event_Manager.instance.carrying && isNew)
                {
                    bPrompt.text              = "Press 'E' to Carry";
                    promptSpawned             = true;
                    ButtonPrompt.promptActive = false;
                }

                if (Input.GetKeyDown(KeyCode.E))
                {
                    bPrompt.text                    = "";
                    promptSpawned                   = false;
                    ButtonPrompt.promptActive       = false;
                    Event_Manager.instance.carrying = true;
                }
            }
        }
    }
Ejemplo n.º 16
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.name == "Player")
     {
         if (Event_Manager.isEventActive(1, 2))
         {
             if (!ButtonPrompt.promptActive)
             {
                 bPrompt.text = "Press 'E' To Turn On";
                 ButtonPrompt.promptActive = true;
             }
         }
         else if (!lightsAreOff)
         {
             if (!ButtonPrompt.promptActive)
             {
                 bPrompt.text = "This is used to turn the power to the farm on.";
                 ButtonPrompt.promptActive = true;
             }
         }
     }
 }
Ejemplo n.º 17
0
    public void TimeChange(int number)
    {
        if ((Game_Manager.instance.Speed <= 0.1f && !Malfunction || Game_Manager.instance.Gravity <= 0.5f && !Malfunction))
        {
            Event_Manager.Wheels_Malfunction();
            Game_Manager.instance.Lives--;
            Malfunction = true;
        }
        if (Malfunction)
        {
            return;
        }
        switch (number)
        {
        case (0):
            Change_Time(Time_States.Speed);
            break;

        case (1):
            Change_Time(Time_States.Gravity);
            break;
        }
    }
Ejemplo n.º 18
0
 void Change_Time(Time_States _ts)
 {
     Event_Manager.Time_Change(_ts);
 }
Ejemplo n.º 19
0
 void Start()
 {
     EM = GameObject.Find("Event_Manager").GetComponent <Event_Manager>();
 }
Ejemplo n.º 20
0
 private void Awake()
 {
     instance = this;
 }
Ejemplo n.º 21
0
 // Use this for initialization
 void Start()
 {
     _static = GetComponent<Static>();
     EM = GetComponent<Event_Manager>();
 }
Ejemplo n.º 22
0
 void Start()
 {
     _readyToAttack = true;
     _manager       = FindObjectOfType <Event_Manager>();
 }