Hopefully this is my last question today Again, I am cleaning up code with my conversion and I am running across an interesting warning message. It states:
PlayVideo.cs(15,25): warning CS0108: `PlayVideo.audio' hides inherited member 'UnityEngine.Component.audio'. Use the new keyword if hiding was intended
The line it refers to in my script is:
private AudioSource audio;
This is my movie texture script I wrote. Although it works just fine, I would just like to know exactly what is throwing the warning. If you would like to see the whole script, click on it below.
Full Script
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
[RequireComponent (typeof (AudioSource))]
public class PlayVideo : MonoBehaviour {
public UnityEngine.MovieTexture movie;
public int level = 1; //Level to open after splash
public float setTime = 3.0f; //Duration before loading next level
private AudioSource audio;
float timer; // Use this for initialization
void Start () {
GetComponent<RawImage>().texture = movie as MovieTexture;
audio = GetComponent<AudioSource>();
audio.clip = movie.audioClip;
movie.Play();
audio.Play();
timer = 0.0f; //Initializes Timer to 0
}
void Update () {
timer += Time.deltaTime; //Adds Time.deltaTime to timer each update
if (timer > setTime)
{
SceneManager.LoadScene(level); //Loads Level at index
}
}
}