Ejemplo n.º 1
0
    public static PhxRuntimeEnvironment Create(PhxPath envPath, PhxPath fallbackPath = null, bool initMatch = true)
    {
        if (!envPath.Exists())
        {
            Debug.LogErrorFormat("Given environment path '{0}' doesn't exist!", envPath);
            return(null);
        }

        if (fallbackPath == null)
        {
            fallbackPath = envPath;
        }
        Debug.Assert(fallbackPath.Exists());

        PhxAnimationLoader.ClearDB();
        GameLuaEvents.Clear();

        PhxRuntimeEnvironment rt = new PhxRuntimeEnvironment(envPath, fallbackPath);

        rt.ScheduleLVLRel("core.lvl");
        rt.ScheduleLVLRel("shell.lvl");
        rt.ScheduleLVLRel("common.lvl");
        rt.ScheduleLVLRel("mission.lvl");
        rt.ScheduleSoundBankRel("sound/common.bnk");

        rt.RTScene = new PhxRuntimeScene(rt, rt.EnvCon);
        rt.Match   = initMatch ? new PhxRuntimeMatch() : null;
        rt.Timers  = new PhxTimerDB();

        PhxAnimationLoader.Con = rt.EnvCon;

        return(rt);
    }
Ejemplo n.º 2
0
 CraPlayer GetPlayer(Transform root, string[] animBanks, string animName, bool loop, string maskBone = null)
 {
     if (ClipPlayers.TryGetValue(animName, out CraPlayer player))
     {
         return(player);
     }
     player = PhxAnimationLoader.CreatePlayer(root, animBanks, animName, loop, maskBone);
     ClipPlayers.Add(animName, player);
     return(player);
 }