Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        source = GetComponent <AudioSource>();
        if (isThereBegVoiceAct) //if level does not have beginning voicing
        {
            StartCoroutine("BeginningVoiceActing");
        }
        currentWave = waves[wavePoint];

        bossWave = false;

        if (boss != null)
        {
            bossCode = boss.GetComponent <BossGOAP>();
        }

        currentVoice = null;

        grid = new AGrid(this.transform, gridSizeX, gridSizeY, nodeRadius, unwalkable);// set up astar dll
        grid.CreateNodes();
        pathfinding = new APathFinding();
    }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("TitleId,ActorId,Id")] VoiceActing voiceActing)
        {
            if (id != voiceActing.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(voiceActing);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VoiceActingExists(voiceActing.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActorId"] = new SelectList(_context.VoiceActors, "Id", "Name", voiceActing.ActorId);
            ViewData["TitleId"] = new SelectList(_context.Title, "Id", "Name", voiceActing.TitleId);
            return(View(voiceActing));
        }
Ejemplo n.º 3
0
 public void set(VoiceActing v)
 {
     showTime    = v.showTime;
     volumeScale = v.volumeScale;
     lines       = new Line[v.lines.Length];
     v.lines.CopyTo(lines, 0);
     time  = v.time;
     plays = (SortedList)v.plays.Clone();
 }
Ejemplo n.º 4
0
    public VoiceActing getDuplicate()
    {
        VoiceActing tmp = new VoiceActing();

        tmp.showTime    = showTime;
        tmp.volumeScale = volumeScale;
        tmp.lines       = new Line[lines.Length];
        lines.CopyTo(tmp.lines, 0);
        tmp.time  = time;
        tmp.plays = (SortedList)plays.Clone();
        return(tmp);
    }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("TitleId,ActorId,Id")] VoiceActing voiceActing)
        {
            if (ModelState.IsValid)
            {
                _context.Add(voiceActing);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActorId"] = new SelectList(_context.VoiceActors, "Id", "Name", voiceActing.ActorId);
            ViewData["TitleId"] = new SelectList(_context.Title, "Id", "Name", voiceActing.TitleId);
            return(View(voiceActing));
        }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        va             = GetComponent <VoiceActing>();
        playerSyncData = GetComponent <PlayerSyncData>();
        hitMarkerAS    = GetComponent <AudioSource>();
        SemiGunPrefabTeam1.SetActive(false);
        AutoGunPrefabTeam1.SetActive(false);
        ShotgunPrefabTeam1.SetActive(false);
        SemiGunPrefabTeam2.SetActive(false);
        AutoGunPrefabTeam2.SetActive(false);
        ShotgunPrefabTeam2.SetActive(false);
        Team1AutoGun.SetActive(false);
        Team2AutoGun.SetActive(false);
        Team1SemiGun.SetActive(false);
        Team1Shotgun.SetActive(false);
        Team2SemiGun.SetActive(false);
        Team2Shotgun.SetActive(false);

        if (!isLocalPlayer)
        {
            SetActiveGun(SemiGunTeam1);
            SetLayerRecursively(ShotgunPrefabTeam1, LayerMask.NameToLayer("Ignore Raycast"));
            SetLayerRecursively(AutoGunPrefabTeam1, LayerMask.NameToLayer("Ignore Raycast"));
            SetLayerRecursively(SemiGunPrefabTeam1, LayerMask.NameToLayer("Ignore Raycast"));
            SetLayerRecursively(ShotgunPrefabTeam2, LayerMask.NameToLayer("Ignore Raycast"));
            SetLayerRecursively(AutoGunPrefabTeam2, LayerMask.NameToLayer("Ignore Raycast"));
            SetLayerRecursively(SemiGunPrefabTeam2, LayerMask.NameToLayer("Ignore Raycast"));
            Team1AutoGun.SetActive(true);
            return;
        }



        HitMarker.SetActive(false);
        grenadesLeft = numberOfGrenades;
        input        = GetComponent <CharacterInput>();
        ammoText     = AmmoVisual.GetComponent <Text>();
        grenadeText  = GrenadeVisual.GetComponent <Text>();

        SemiGunPrefabTeam1.SetActive(true);
        SetActiveGun(SemiGunTeam1);

        AutoGunPrefabTeam1.SetActive(false);
        ShotgunPrefabTeam1.SetActive(false);
        SemiGunPrefabTeam1.SetActive(false);
        SemiGunPrefabTeam2.SetActive(false);
        AutoGunPrefabTeam2.SetActive(false);
        ShotgunPrefabTeam2.SetActive(false);
    }
    IEnumerator resetPosition()
    {
        // TODO: Add image effect or warning on screen
        VoiceActing tmp = voiceActing.GetComponent <VoiceActing>().getDuplicate();

        yield return(new WaitForSeconds(10.0f));

        if (edgarMustang != null && !GetComponent <Collider>().bounds.Contains(edgarMustang.position))
        {
            Debug.Log("RESETTING BECAUSE STILL OUT OF RANGE");
            voiceActing.GetComponent <VoiceActing>().set(tmp);
            time                  = outOfRangeTime;
            index                 = outOfRangeIndex;
            currentRecord         = parseLine(Mathf.Max(0, index - 2));
            nextRecord            = parseLine(Mathf.Max(1, index - 1));
            edgarMustang.position = edgarOutOfRangePos + 0.5f * GetComponent <SphereCollider>().radius *(currentRecord.position - edgarOutOfRangePos).normalized;
            edgarMustang.rotation = Quaternion.Euler(currentRecord.rotationEuler);
            edgarMustang.GetComponent <Rigidbody>().velocity = (nextRecord.position - currentRecord.position) / (nextRecord.time - currentRecord.time);
        }
    }
Ejemplo n.º 8
0
    void Start()
    {
        animScript = GetComponent <NetworkAnimScript>();
        if (isLocalPlayer)
        {
            cc       = GetComponent <CharacterController3D>();
            input    = GetComponent <CharacterInput>();
            splatMat = splatPanel.GetComponent <Image>().material;
            deathMat = deathPanel.GetComponent <Image>().material;
            deathMat.SetFloat("_FadeToBlack", 0f);
            spawnPoints    = FindObjectsOfType <NetworkStartPosition>();
            spawnLocations = GameObject.FindGameObjectsWithTag("Spawn Location");
        }
        va          = GetComponent <VoiceActing>();
        colliderPos = GetComponent <CapsuleCollider>().center;
        if (isServer)
        {
            scores = GameObject.Find("Score Manager").GetComponent <ScoreManager>();
        }
        int netID = (int)GetComponent <NetworkIdentity>().netId.Value;

        audioS = GetComponent <AudioSource>();
    }
Ejemplo n.º 9
0
    IEnumerator BeginningVoiceActing()
    {
        yield return(new WaitForSeconds(2f));

        currentVoice = beginningVoice;
    }
Ejemplo n.º 10
0
 public void WaveVoiceAct(VoiceActing voice)
 {
     currentVoice = voice;
 }