I need help with this title screen I’m making for my game. First of all I’m a newbie and I am making this title screen using methods I’ve gathered from different sources. I keep getting error CS1023 (49,36) and error 0246 (26,9). I don’t know whats wrong on line 49 and 26. What this code is basically supposed to do is hide a RawImage on the Canvas upon a keypress so that a different RawImage will be revealed, then when the second RawImage image is being displayed background music should start playing.
Also if you see a better method than what I’m doing (or trying to do) please give it to me. The variable names are arbitrary by the way and have no real significance.
using UnityEngine;
using System.Collections;
public class splash : MonoBehaviour {
// Use this for initialization
void Start () {
}
private string splashcurr ="notyet";
private string titlestate ="no";
public float splash_count = 4.0f;
private AudioSource source1;
// Update is called once per frame
void Update () {
if (splash_count <= 0.0f)
splashcurr ="summon";
else
splash_count -= Time.deltaTime;
}
// Checks for keypress
function Update() {
if(Input.GetMouseButtonDown(0))
splashcurr ="summon";
if(Input.GetKeyDown (KeyCode.Space)){
if (splashcurr="summon")
splashcurr="ontitle";
else
splashcurr ="summon";
}
if(Input.GetKeyDown (KeyCode.Return))
splashcurr ="summon";
call SplashCheck;
}
// Code for checking and clicking between splashes
void SplashCheck () {
if(splashcurr="summon") {
renderer.enabled=false= Gameobject.Find("IEntertain");
splashcurr ="ontitle";
}
if(splashcurr="ontitle") {
titlestate="now";
Quethemusic;
}
}
void Quethemusic () {
if (titlestate="now")
source1.Play();
}
}