示例#1
0
        // Use this for initialization
        void Start()
        {
            SMPtr = Camera.main.GetComponent <SceneManager>().ScriptMaster;
            SMPtr.RegisterCustomFunction(new M22.CustomFunctions.DrawSprite());
            SMPtr.RegisterCustomFunction(new M22.CustomFunctions.HeartThrob());
            SMPtr.RegisterCustomFunction(new M22.CustomFunctions.SakuraEffect());
            SMPtr.RegisterCustomFunction(new M22.CustomFunctions.SnowEffect());
            SMPtr.RegisterCustomFunction(new M22.CustomFunctions.WrittenNote());
            SMPtr.RegisterCustomFunction(new M22.CustomFunctions.HospitalMask());
            M22.ScriptCompiler.InitializeCustomFunctions();
            SMPtr.LoadScript("START_SCRIPT");

            if (DebugDisplayPrefab == null)
            {
                DebugDisplayPrefab = Resources.Load <GameObject>("Prefabs/DebugDisplay") as GameObject;
                if (DebugDisplayPrefab != null)
                {
                    GameObject.Instantiate <GameObject>(DebugDisplayPrefab, Camera.main.transform);
                }
            }
            else
            {
                GameObject.Instantiate <GameObject>(DebugDisplayPrefab, Camera.main.transform);
            }
        }
示例#2
0
 public static void RegisterCustomFunction(CustomFunction func, ref ScriptMaster smPtr)
 {
     if (RegisteredCustomFunctions == null)
     {
         RegisteredCustomFunctions = new Dictionary <string, CustomFunction>();
     }
     func.SetScriptMaster(ref smPtr);
     RegisteredCustomFunctions.Add(func.Keyword(), func);
     func.Awake();
 }
示例#3
0
        // Use this for initialization
        void Start()
        {
            SMPtr = Camera.main.GetComponent <ScriptMaster>();
            SMPtr.LoadScript("START_SCRIPT");

            if (DebugMode == true)
            {
                GameObject debugPrefab = Resources.Load <GameObject>("Prefabs/DebugDisplay") as GameObject;
                if (debugPrefab != null)
                {
                    GameObject.Instantiate <GameObject>(debugPrefab, Camera.main.transform);
                }
            }
        }
示例#4
0
        void Awake()
        {
            if (!(camera = this.GetComponent <Camera>()))
            {
                throw new System.Exception("[SceneManager] Needs to be attached to a camera.");
            }

            this.AddPrefabs();

            musicSource = this.gameObject.AddComponent <AudioSource>();
            musicSource.bypassEffects     = true;
            musicSource.bypassReverbZones = true;
            musicSource.loop     = true;
            musicSource.priority = 64;
            musicSource.outputAudioMixerGroup = this.outputAudioMixer;
            audioMaster = new AudioMaster(musicSource, this);

            vnHandler    = new VNHandler(CharacterPrefab);
            scriptMaster = new ScriptMaster(
                vnHandler,
                audioMaster,
                TextboxCanvas.transform.Find("Textbox").GetComponent <Image>(),
                DecisionsPrefab,
                TransitionPrefab,
                VideoPlayerPrefab,
                LoopedSFXPrefab
                );
            scriptMaster.background        = BackgroundCanvas.gameObject.transform.Find("Background").gameObject.GetComponent <Image>();
            scriptMaster.backgroundTrans   = BackgroundCanvas.gameObject.transform.Find("BackgroundTransition").gameObject.GetComponent <Image>();
            scriptMaster.TEXT              = TextboxCanvas.gameObject.transform.GetComponentInChildren <TypeWriterScript>();
            scriptMaster.TransitionPrefab  = this.TransitionPrefab;
            scriptMaster.DecisionsPrefab   = this.DecisionsPrefab;
            scriptMaster.VideoPlayerPrefab = this.VideoPlayerPrefab;

            customFunctionality = new CustomFunctionHandler();
        }
示例#5
0
 // Use this for initialization
 void Start()
 {
     SM = Camera.main.GetComponent <ScriptMaster>();
     VN = Camera.main.GetComponent <VNHandler>();
 }
示例#6
0
 public void SetParent(ScriptMaster _scriptMaster)
 {
     scriptMaster = _scriptMaster;
 }
示例#7
0
 public void SetScriptMaster(ref ScriptMaster smPtr)
 {
     this.scriptMaster = smPtr;
 }
示例#8
0
 // Use this for initialization
 void Start()
 {
     SM = Camera.main.GetComponent <SceneManager>().ScriptMaster;
     VN = Camera.main.GetComponent <SceneManager>().VNHandler;
 }