Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     SM = Camera.main.GetComponent <ScriptMaster>();
     VN = Camera.main.GetComponent <VNHandler>();
 }
Ejemplo n.º 6
0
 public void SetParent(ScriptMaster _scriptMaster)
 {
     scriptMaster = _scriptMaster;
 }
Ejemplo n.º 7
0
 public void SetScriptMaster(ref ScriptMaster smPtr)
 {
     this.scriptMaster = smPtr;
 }
Ejemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     SM = Camera.main.GetComponent <SceneManager>().ScriptMaster;
     VN = Camera.main.GetComponent <SceneManager>().VNHandler;
 }