예제 #1
0
        public static GameObject Instantiate(ENTITY e)
        {
            GameObject  instantiated = new GameObject(e.Classname);
            TriggerLink script       = instantiated.AddComponent <TriggerLink>();

            script.ForceFadeColor      = e.GetSpawnflagValue(0, 4);
            script.LinkToSpecificLevel = e.GetSpawnflagValue(1, 4);
            script.ForceSpawnPoint     = e.GetSpawnflagValue(2, 4);
            script.PlayLinkSound       = e.GetSpawnflagValue(3, 4);

            if (script.LinkToSpecificLevel)
            {
                script.LinkedLevel = IOUtil.PathCombine("levels", e.GetPropertyValue("Linked level"));
            }
            if (script.ForceFadeColor)
            {
                script.ForcedLinkColor = EntityUtil.TryParseColor("Forced link color", e);
            }
            if (script.ForceSpawnPoint)
            {
                script.SpawnPointName = e.GetPropertyValue("Spawn point name");
            }

            EntityUtil.SetInstantiatedObjectTransform(e, ref instantiated);

            instantiated.AddComponent <BoxCollider>().isTrigger = true;

            return(instantiated);
        }
예제 #2
0
 public TriggerLinkMemento(TriggerLink state) : base(state)
 {
     LinkedLevel        = state.LinkedLevel;
     ForcedLinkColor    = state.ForcedLinkColor;
     SpawnPointEntityID = state.SpawnPointEntityID;
     ForceFadeColor     = state.ForceFadeColor;
     PlayLinkSound      = state.PlayLinkSound;
 }