示例#1
0
        // set a skill tree icon for a skill
        public static void SetSkillSmallIcon(int id, string textureName)
        {
            Skill skill = ResourcesPrefabManager.Instance.GetItemPrefab(id) as Skill;
            var   tex   = SL.Instance.TextureData[textureName];

            tex.filterMode      = FilterMode.Bilinear;
            skill.SkillTreeIcon = TexReplacer.CreateSprite(tex);
        }
示例#2
0
        public void SetItemIcon(Item item, Texture2D icon)
        {
            var sprite = TexReplacer.CreateSprite(icon);

            At.SetValue(sprite, typeof(Item), item, "m_itemIcon");
        }
示例#3
0
        private IEnumerator Init()
        {
            Log("Version " + SL.BaseInstance.Version + " starting...", 0);

            // Add Components
            this.gameObject.AddComponent <AssetBundleLoader>();
            this.gameObject.AddComponent <TexReplacer>();
            this.gameObject.AddComponent <CustomItems>();
            this.gameObject.AddComponent <AudioReplacer>();
            this.gameObject.AddComponent <CustomSkills>();
            this.gameObject.AddComponent <CustomCharacters>();

            // legacy references
            CustomItems = this.gameObject.GetComponent <CustomItems>();
            TexReplacer = this.gameObject.GetComponent <TexReplacer>();

            // read folders, store all file paths in FilePaths dictionary
            CheckFolders();

            // wait for RPM to finish loading
            while (!ResourcesPrefabManager.Instance.Loaded)
            {
                yield return(null);
            }

            // load texture changes
            Loading = true;
            StartCoroutine(TexReplacer.Instance.LoadTextures());
            while (Loading)
            {
                yield return(null);
            }                                      // wait for loading callback to be set to false

            // load asset bundles
            Loading = true;
            StartCoroutine(AssetBundleLoader.Instance.LoadAssetBundles());
            while (Loading)
            {
                yield return(null);
            }

            // load custom items
            Loading = true;
            StartCoroutine(CustomItems.Instance.LoadItems());
            while (Loading)
            {
                yield return(null);
            }

            // load audio filepaths
            Loading = true;
            StartCoroutine(AudioReplacer.Instance.LoadAudioClips());
            while (Loading)
            {
                yield return(null);
            }

            // load something else...

            // Check currently loaded assets and replace what we can
            Loading = true;
            StartCoroutine(TexReplacer.Instance.ReplaceActiveAssets());
            while (Loading)
            {
                yield return(null);
            }

            Log("Finished initialization.", 0);
            InitDone = 1;
        }
示例#4
0
 internal void Awake()
 {
     Instance = this;
 }