Ejemplo n.º 1
0
        private void audio_PlayStateChange1(int newState)
        {
            status = wplayer.status;
            if (newState == 3)
            {
                isPlayed = true;
            }

            if (isPlayed && newState == 1)
            {
                isPlayed = false;
                if (fileNums != null && fileNums.Count > 0)
                {
                    fileNums.RemoveAt(0);
                }
                if (fileNums == null || fileNums.ToList().Count() == 0)
                {
                    status        = READY;
                    objAudioCache = null;
                }
                else if (fileNums != null && fileNums.Count > 0)
                {
                    InitPlayAudio(fileNums.First());
                }
            }
        }
Ejemplo n.º 2
0
 public EventAudio(string action, Dictionary <string, Counter> dicCounter, Dictionary <string, Ticket> dicServing, ObjectAudio audio)
 {
     this.Action     = action;
     this.DicCounter = dicCounter;
     this.audio      = audio;
     this.DicServing = dicServing;
 }
Ejemplo n.º 3
0
    public void Awake()
    {
        //기본상태로 야생동물이 맵 전체를 무작위로 돌아다니는 Patrol
        state = State.Patrol;
        InitTarget();

        SightRange  = transform.Find("SightRangeCollider").GetComponent <SightRangeCollider>();
        AttackRange = transform.Find("AttackRangeCollider").GetComponent <AttackRangeCollider>();

        detect      = new GameObject();
        detect.name = "DetectPoint";

        wayPoint      = new GameObject();
        wayPoint.name = "WayPoint";

        animator             = GetComponent <Animator>();
        aiPath               = GetComponent <AIPath>();
        aiPath.rotationSpeed = rotationDamping;

        spawnBounds = GameObject.Find("/GameController/SpawnManager/SpawnBox").GetComponent <BoxCollider>().bounds;
        MinX        = spawnBounds.min.x;
        MaxX        = spawnBounds.max.x;
        MinZ        = spawnBounds.min.z;
        MaxZ        = spawnBounds.max.z;

        if (GetComponent <ObjectAudio>() != null)
        {
            Audio = GetComponent <ObjectAudio>();
        }
    }
Ejemplo n.º 4
0
    void Awake()
    {
        /*
         * for (int i = 0; i < patrol.Length; i++)
         * {
         *  patrol[i].y  = transform.position.y;
         * }
         */
        nav = GetComponent <NavMeshAgent>();
        if (patrol.Length > 1)
        {
            patrolIndex        = Random.Range(1, patrol.Length - 1); //just start somewhere.
            transform.position = patrol[patrolIndex - 1];            //assign it so we arent travelling randomly
            nav.SetDestination(patrol[patrolIndex]);
        }
        else
        {
            singlePointEulerRotation = transform.eulerAngles; //store current rotation for later
        }

        investigationPoint = new Vector3(-999, -999, -999); //Going off of the sheer confidence that this value won't be an investigation point?
        //watch it be, you silly man
        NULL_IP = investigationPoint;
        //TODO: may need to change that, because Vector3s are *not* nullable.
        IP  = transform.parent.GetComponentInChildren <InvestigationPoint>();
        aud = GetComponent <ObjectAudio>();
    }
Ejemplo n.º 5
0
 private void Start()
 {
     nav              = GetComponent <NavMeshAgent>();
     pEffects         = player.GetComponent <PlayerEffects>();
     pHealth          = player.GetComponent <PlayerHealth>();
     aud              = GetComponent <ObjectAudio>();
     viz.CurrentColor = new Color(140f / 255f, 0, 241f / 255f);
 }
Ejemplo n.º 6
0
 public virtual void Start()
 {
     if (GetComponent <ObjectAudio>() != null)
     {
         Audio = GetComponent <ObjectAudio>();
     }
     GoToNextState();
 }
Ejemplo n.º 7
0
 void Start()
 {
     r                = GetComponent <Renderer>();
     pc               = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     fenceMat         = fence.GetComponent <Renderer>().material;
     r.material.color = fenceMat.GetColor("_Color"); //set the color of this switch to the fence's electricity color!
     fenceOn          = r.material.color;            //store the original color of the fence for later.
     f                = fence.GetComponent <Fence>();
     aud              = GetComponent <ObjectAudio>();
 }
Ejemplo n.º 8
0
 private void Start()
 {
     wallMat.SetFloat("Vector1_2F06040B", 1.00f);
     dissolveMat.SetFloat("Vector1_2F06040B", 0.0f); //needs to always start fully uncloaked!
     cc = GetComponent <CharacterController>();
     groundCheck.localPosition = new Vector3(0, -cc.bounds.extents.y, 0);
     phealth            = GetComponent <PlayerHealth>();
     aud                = GetComponent <ObjectAudio>();
     cloakingCoroutines = new List <Coroutine>();
 }
Ejemplo n.º 9
0
        private void finish(EventSocketSendProgram eventData)
        {
            var    ticket    = eventData.Ticket;
            string counterID = "";

            counterID = ticket.counter_id;
            var        objAudioFinish  = new ObjectAudio("", "", "", "", counterID);
            EventAudio eventSendFinish = new EventAudio(eventData.Action, null, null, objAudioFinish);

            DataReceived(eventSendFinish);
        }
    public void Play(ObjectAudio objectAudio)
    {
        switch (objectAudio)
        {
        case ObjectAudio.Explosion:
            _objectAudioSrc[0].Play();
            break;

        case ObjectAudio.PowerUp:
            _objectAudioSrc[1].Play();
            break;
        }
    }
Ejemplo n.º 11
0
 void call(EventSocketSendProgram eventData)
 {
     if (eventData != null && eventData.Ticket != null && !string.IsNullOrWhiteSpace(eventData.Ticket.id))
     {
         var ticketID = eventData.Ticket.id;
         if (!checkExistNum(ticketID))
         {
             var counterID  = eventData.Ticket.counter_id;
             var counterNum = dicCounter[counterID].Data.Cnum;
             var objAudio   = new ObjectAudio(eventData.Ticket.cnum, counterNum + "", ticketID, eventData.Ticket.lang, counterID);
             mQueue.WaitOne();
             this.sendQueueByNum.Enqueue(objAudio);
             mQueue.ReleaseMutex();
             EventAudio eventSendFinish = new EventAudio(eventData.Action, null, null, objAudio);
             DataReceived(eventSendFinish);
         }
     }
 }
Ejemplo n.º 12
0
    void Start()
    {
        ObjectFactory.CreateRigibody(this);
        lanuchSoundAudio = new ObjectAudio(this, launchSound);

        gameControl = FindObjectOfType <GameControl>();
        UpdateMousePosition();

        // TODO - line color fix, currently not working
        lineRenderer                  = gameObject.AddComponent <LineRenderer>();
        lineRenderer.startColor       = Color.red;
        lineRenderer.endColor         = Color.red;
        lineRenderer.startWidth       = 0.1f;
        lineRenderer.endWidth         = 0.1f;
        lineRenderer.enabled          = false;
        lineRenderer.sortingLayerName = "Line";

        EnableSpaceShipAnimation(false);
    }
Ejemplo n.º 13
0
    private void Start()
    {
        var audio = new ObjectAudio(this, explosionSound);

        AudioSource = audio.AudioSource;
    }
Ejemplo n.º 14
0
 private void Start()
 {
     chaseBotEnemy.gameObject.SetActive(false); //backup just in case
     aud = GetComponent <ObjectAudio>();
 }
Ejemplo n.º 15
0
 private void Start()
 {
     aud = GetComponent <ObjectAudio>();
 }
Ejemplo n.º 16
0
        private void addMedia(ObjectAudio objAudio)
        {
            try
            {
                string lang  = objAudio.Lang;
                var    items = new List <Item>();
                Dictionary <string, string> dic = null;
                switch (lang)
                {
                case ActionTicket.LANG_EN:
                    items = voice.i18n.en.items;
                    dic   = fileAudioEns;
                    break;

                case ActionTicket.LANG_SP:
                    items = voice.i18n.sp.items;
                    dic   = fileAudioSps;
                    break;

                default:
                    items = voice.i18n.vi.items;
                    dic   = fileAudioVis;
                    break;
                }

                foreach (var item in items)
                {
                    switch (item.type)
                    {
                    case ActionTicket.TYPE_URL:
                        addItemList(item.value, dic);
                        break;

                    case ActionTicket.TYPE_DATA:
                        if (item.value == ActionTicket.TICKET_NUMBER)
                        {
                            foreach (char num in objAudio.Cnum)
                            {
                                string numAudio = num.ToString();
                                addItemList(numAudio, dic);
                            }
                        }
                        else
                        {
                            var num = objAudio.ArrNumC[0].ToString();
                            if (num.Equals("0"))
                            {
                                foreach (char numC in objAudio.ArrNumC)
                                {
                                    string numAudio = numC.ToString();
                                    addItemList(numAudio, dic);
                                }
                            }
                            else
                            {
                                string numC = objAudio.CounterNum;
                                addItemList(numC, dic);
                            }
                        }
                        break;

                    default: break;
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }