Exemple #1
0
        // Execute the action
        public int Execute(HeroKitObject hko)
        {
            heroKitObject = hko;

            GameObject menuTemplate = PrefabValue.GetValue(heroKitObject, 0);
            bool       runThis      = (menuTemplate != null);

            if (runThis)
            {
                // if new prefab is not in scene, delete the old one from scene and attach new prefab to settings.
                GameObject prefab = HeroKitCommonRuntime.settingsInfo.dialogBox;
                if (prefab != null && prefab != menuTemplate)
                {
                    HeroKitCommonRuntime.DeletePrefabFromScene(prefab, true);
                    HeroKitCommonRuntime.settingsInfo.dialogBox = menuTemplate;
                }
            }

            if (heroKitObject.debugHeroObject)
            {
                Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject));
            }

            return(-99);
        }