Ejemplo n.º 1
0
    void OnTriggerEnter(Collider collider)
    {
        if (!_attacking)
        {
            if (collider.gameObject.tag == "Girl")
            {
                CharGirl girl = collider.GetComponent <CharGirl>();

                if (girl != null)
                {
                    if (girl.mobile)
                    {
                        if (ui_fade.IsHidden())
                        {
                            switch (UnityEngine.Random.Range(0, 3))
                            {
                            case 0: ui_fade.header_text = "YOU'VE BEEN\nGLOMPED!";
                                break;

                            case 1: ui_fade.header_text = "EWW!\nKOOTIES!";
                                break;

                            case 2: ui_fade.header_text = "NO-SCOPED\nBY CUPID!";
                                break;
                            }

                            ui_fade.show_btn_resume    = false;
                            ui_fade.show_btn_next      = false;
                            ui_fade.show_btn_retry     = true;
                            ui_fade.show_btn_main_menu = true;
                            ui_fade.Load();

                            ManagerMusic.PlayGameOverMusic();
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
    public void PunchContact(List <Collider> lst_colliders)
    {
        if (_attacking &&
            !_springing_back)
        {
            foreach (Collider collider in lst_colliders)
            {
                if (collider.gameObject.tag == "Girl")
                {
                    CharGirl girl = collider.GetComponent <CharGirl>();

                    if (girl != null)
                    {
                        if (girl.mobile)
                        {
                            girl.Hit();

                            HitAllGirlsWithinBurst();

                            _springing_back = true;
                            _animator.SetBool("spring_back", true);

                            return;
                        }
                    }
                }
                else
                if (collider.gameObject.tag == "Wall")
                {
                    _springing_back = true;
                    _animator.SetBool("spring_back", true);
                }
            }
        }
        // Debug.Log("Punched '"+collider.name+"'");
    }
Ejemplo n.º 3
0
    private void SpawnPrefabLogic(CharGirl prefab, SpawnSettings settings, List <Spawn> lst_spawns)
    {
        if (settings.spawn_count > 0)
        {
            settings.time_since_spawn += Time.deltaTime;

            if (settings.time_since_spawn >= settings.delay)
            {
                // Reset the delay to next spawning.
                settings.time_since_spawn = 0.0f;
                settings.delay            = settings.interval;

                // Decrement the spawn count.
                int count = Mathf.Min(settings.spawn_count, settings.cluster_size);
                settings.spawn_count -= count;

                // Loop until we've spawned this cluster.
                for (int index_spawn = 0; index_spawn < count; ++index_spawn)
                {
                    Spawn spawn = lst_spawns[UnityEngine.Random.Range(0, lst_spawns.Count)];

                    Vector3 spawn_pos = new Vector3
                                        (
                        UnityEngine.Random.Range(spawn.bounds.min.x, spawn.bounds.max.x),
                        0.0f,
                        UnityEngine.Random.Range(spawn.bounds.min.z, spawn.bounds.max.z)
                                        );

                    CharGirl girl = Instantiate(prefab);
                    girl.transform.SetParent(transform);
                    girl.transform.position = spawn_pos;
                    girl.transform.rotation = Quaternion.LookRotation(-spawn_pos, Vector3.up);
                }
            }
        }
    }