Ejemplo n.º 1
0
 protected override void OnStart()
 {
     screechAudioSource              = AudioManager.AddAudioSource(gameObject, screechSound, .2f, true, AudioManager.Instance.sfxGroup);
     jumpAudioSource                 = AudioManager.AddAudioSource(gameObject, jumpSound, 1, true, AudioManager.Instance.sfxGroup);
     pounceAudioSource               = AudioManager.AddAudioSource(gameObject, pounceSound, 0.5f, true, AudioManager.Instance.sfxGroup);
     wallClingAudioSource            = AudioManager.AddAudioSource(gameObject, wallClingSound, .5f, true, AudioManager.Instance.sfxGroup);
     pounceSecondarySoundSet         = gameObject.AddComponent <RandomSoundSet>();
     pounceSecondarySoundSet.sounds  = pounceSecondarySounds;
     pounceSecondarySoundSet.rolloff = true;
     pounceSecondarySoundSet.volume  = 0.25f;
     infectRangeIndicator            = GetComponentInChildren <InfectRangeIndicator>();
     if (HasAuthority())
     {
         infectRangeIndicator.SetOriginTransform(transform);
         if (CharacterSpawner.parasiteData.isVamparasite)
         {
             ChangeToVampColour();
         }
     }
     else
     {
         infectRangeIndicator.enabled = false;
     }
     flashColourRotator = new ColourRotator(flashColours);
 }
Ejemplo n.º 2
0
    public void Initialize(Vector2 startPoint, Vector2 endPoint)
    {
        this.startPoint = startPoint;
        this.endPoint   = endPoint;
        normal          = Vector2.Perpendicular(endPoint - startPoint).normalized;
        hitboxSize      = new Vector2(Vector2.Distance(startPoint, endPoint), energyRadius);
        hitboxAngle     = Vector2.SignedAngle(Vector2.up, normal);
        hitboxRay       = new Ray2D(startPoint, endPoint - startPoint);
        // Stretch sprite between connecting orbs
        spriteRenderer = GetComponentInChildren <SpriteRenderer>();
        Vector3 spriteScale = new Vector3(
            spriteRenderer.transform.localScale.x * hitboxSize.x,
            spriteRenderer.transform.localScale.y,
            spriteRenderer.transform.localScale.z
            );

        spriteRenderer.transform.localScale = spriteScale;
        spriteRenderer.transform.Rotate(new Vector3(0, 0, hitboxAngle));
        flashColourRotator = new ColourRotator(flashColours);
        InitializeFlashColours();
    }
Ejemplo n.º 3
0
 void InitializeColourMap()
 {
     // Used for cycling parasite health text colours
     parasiteHealthColourRotator = new ColourRotator(flashColours);
 }