Example #1
0
    internal Library_SpriteStudio6.Control.CacheMaterial CacheMaterial = null; /* for Material Overriding */
    #endregion Variables & Properties

    /* ----------------------------------------------- MonoBehaviour-Functions */
    #region MonoBehaviour-Functions
    void Awake()
    {
        /* Data Version Check */
        if ((null == DataCellMap) || (null == DataAnimation))
        {               /* Data invalid */
            return;
        }
        if ((false == DataCellMap.VersionCheckRuntime() || (false == DataAnimation.VersionCheckRuntime())))
        {               /* Data-Version invalid */
#if MESSAGE_DATAVERSION_INVALID
            Debug.LogError("SS6PU Error(Runtime): Not supported data-version. Need to re-import data. GameObject[" + name
                           + "] Animation[" + DataAnimation.Version.ToString()
                           + "] CellMap[" + DataCellMap.Version.ToString()
                           + "]"
                           );
#endif
            return;
        }

#if EXPERIMENT_FOR_CAMERA
//		ArgumentShareEntire = null;
#endif

        /* Awake Base-Class */
        BaseAwake();
    }
Example #2
0
    /* ******************************************************** */
    //! Get "Cell-Map"'s Index

    /*!
     * @param	Name
     *      "Cell-Map" Name
     * @retval	Return-Value
     *      "Cell-Map"'s Index<br>
     *      -1 == Not-Found / Failure (Error)
     *
     * Get Cell-Map's Index.<br>
     * However, the search target is the only "Cell-Map"s that is initially set ("DataCellMap" member in this Class).
     */
    public int IndexGetCellMap(string Name)
    {
        if (null == DataCellMap)
        {
            return(-1);
        }
        return(DataCellMap.IndexGetCellMap(Name));
    }
Example #3
0
    /* ******************************************************** */
    //! Get Cell-Map count

    /*!
     * @param	FlagConsideringChanged
     *      true == Auto<br>
     *      false == Initially-Set, force<br>
     *      Default: false
     * @retval	Return-Value
     *      Count of "Cell-Map"s<br>
     *      -1 == Failure (Error)
     *
     * Get count of "Cell-Map"s.<br>
     * <br>
     * When "FlagConsideringChanged" is true, this function returns the number of "Cell-Map"s of the changed (If "Cell-Map"-Table has been changed).
     */
    public int CountGetCellMap(bool FlagConsideringChanged = false)
    {
        if ((true == FlagConsideringChanged) && (null != TableCellChange))
        {
            return(Library_SpriteStudio.Utility.TableCellChange.CountGetCellMap(TableCellChange));
        }

        if (null != DataCellMap)
        {
            return(DataCellMap.CountGetCellMap());
        }

        return(-1);
    }
    internal void StartMain()
    {
        /* Boot up master datas */
        /* MEMO: Reason why initial setting of ScriptableObject is done here     */
        /*        (without processing with ScriptableObject's Awake or OnEnable) */
        /*        is to stabilize execution such when re-compile.                */
        if ((null == DataCellMap) || (null == DataEffect))
        {               /* Data invalid */
            goto Start_ErrorEnd;
        }
        if ((false == DataCellMap.VersionCheckRuntime()) || (false == DataEffect.VersionCheckRuntime()))
        {               /* Data-Version invalid */
            goto Start_ErrorEnd;
        }
        FunctionBootUpDataEffect();

        /* Start Base-Class */
        BaseStart();

        /* Boot up Draw-Cluster */
        /* MEMO: Need to run before "ControlEffect.BootUp". */
        if (false == ClusterBootUpDraw())
        {
            goto Start_ErrorEnd;
        }

        /* Boot up Effect-Control */
        if (false == ControlEffect.BootUp(this))
        {
            goto Start_ErrorEnd;
        }
        FrameRange = (float)ControlEffect.DurationFull;

        Status |= FlagBitStatus.VALID;

        /* Play Animation Initialize */
        if (null == InstanceRootParent)
        {
            AnimationPlay();
        }

        return;

        Start_ErrorEnd :;
        Status &= ~FlagBitStatus.VALID;
        return;
    }
Example #5
0
    /* ******************************************************** */
    //! Get Cell count

    /*!
     * @param	IndexCellMap
     *      "Cell-Map"'s Index
     * @param	FlagConsideringChanged
     *      true == Auto<br>
     *      false == Initially-Set, force<br>
     *      Default: false
     * @retval	Return-Value
     *      Count of "Cell-Map"s<br>
     *      -1 == Failure (Error)
     *
     * Get count of Cells in the "Cell-Map".<br>
     * <br>
     * When "FlagConsideringChanged" is true, this function returns the number of cell in "Cell-Map"s of the changed (If "Cell-Map"-Table has been changed).
     */
    public int CountGetCell(int IndexCellMap, bool FlagConsideringChanged = false)
    {
        if ((true == FlagConsideringChanged) && (null != TableCellChange))
        {
            return(Library_SpriteStudio.Utility.TableCellChange.CountGetCell(TableCellChange, IndexCellMap));
        }

        if (null != DataCellMap)
        {
            Library_SpriteStudio.Data.CellMap InstanceCellMap = DataCellMap.DataGetCellMap(IndexCellMap);
            if (null == InstanceCellMap)
            {
                return(-1);
            }
            return(InstanceCellMap.CountGetCell());
        }

        return(-1);
    }
    /* ----------------------------------------------- MonoBehaviour-Functions */
    #region MonoBehaviour-Functions
    void Awake()
    {
        if ((null == DataCellMap) || (null == DataEffect))
        {               /* Data invalid */
            return;
        }
        if ((false == DataEffect.VersionCheckRuntime()) || (false == DataCellMap.VersionCheckRuntime()))
        {               /* Data-Version invalid */
#if MESSAGE_DATAVERSION_INVALID
            Debug.LogError("SS6PU Error(Runtime): Not supported data-version. Need to re-import data. GameObject[" + name
                           + "] Effect[" + DataEffect.Version.ToString()
                           + "] CellMap[" + DataCellMap.Version.ToString()
                           + "]"
                           );
#endif
            return;
        }

        /* Awake Base-Class */
        BaseAwake();
    }
Example #7
0
    /* ******************************************************** */
    //! Get Cell's Index

    /*!
     * @param	IndexCellMap
     *      "Cell-Map"'s Index
     * @param	Name
     *      Cell's Name
     * @param	FlagConsideringChanged
     *      true == Auto<br>
     *      false == Initially-Set, force<br>
     *      Default: false
     * @retval	Return-Value
     *      Cell's Index<br>
     *      -1 == Not-Found / Failure (Error)
     *
     * Get Cell's Index.<br>
     * <br>
     * When "FlagConsideringChanged" is true, this function returns the index of cell in "Cell-Map"s of the changed (If "Cell-Map"-Table has been changed).
     */
    public int IndexGetCell(int IndexCellMap, string NameCell, bool FlagConsideringChanged = false)
    {
        if (true == string.IsNullOrEmpty(NameCell))
        {
            return(-1);
        }

        if ((true == FlagConsideringChanged) && (null != TableCellChange))
        {
            return(Library_SpriteStudio.Utility.TableCellChange.IndexGetCell(TableCellChange, IndexCellMap, NameCell));
        }

        if (null != DataCellMap)
        {
            Library_SpriteStudio.Data.CellMap InstanceCellMap = DataCellMap.DataGetCellMap(IndexCellMap);
            if (null == InstanceCellMap)
            {
                return(-1);
            }
            return(InstanceCellMap.IndexGetCell(NameCell));
        }

        return(-1);
    }
Example #8
0
    internal void StartMain()
    {
        /* Boot up master datas */
        /* MEMO: Reason why initial setting of ScriptableObject is done here     */
        /*        (without processing with ScriptableObject's Awake or OnEnable) */
        /*        is to stabilize execution such when re-compile.                */
        if ((null == DataCellMap) || (null == DataAnimation))
        {               /* Data invalid */
            goto StartMain_ErrorEnd;
        }
        if ((false == DataCellMap.VersionCheckRuntime() || (false == DataAnimation.VersionCheckRuntime())))
        {               /* Data-Version invalid */
            goto StartMain_ErrorEnd;
        }
        FunctionBootUpDataAnimation();

        /* Get Counts */
        CountPartsSprite = DataAnimation.CountGetPartsSprite();
        CountSpriteMax   = 0;           /* Set in ClusterBootUpDraw */
        CountMeshMax     = 0;           /* Set in ClusterBootUpDraw */
        CountParticleMax = 0;           /* Set in ClusterBootUpDraw */

        /* Start Base-Class */
        if (false == BaseStart())
        {
            goto StartMain_ErrorEnd;
        }

        /* Generate Play-Track */
        int countTrack = ControlBootUpTrack(-1);

        if (0 >= countTrack)
        {
            goto StartMain_ErrorEnd;
        }

        /* Check Play-Information */
        if (false == InformationCheckPlay(countTrack))
        {
            goto StartMain_ErrorEnd;
        }

        /* Boot up Parts-Control */
        if (false == ControlBootUpParts(CountSpriteMax))
        {
            goto StartMain_ErrorEnd;
        }

        /* Boot up Draw-Chain */
        if (false == ChainDrawBootUp())
        {
            goto StartMain_ErrorEnd;
        }

        /* Boot up Draw-Cluster */
        /* MEMO: CAUTION. Caution that Parent-"Root" is not necessarily initialized earlier in generation order of GameObjects on the scene. */
        /*       ("ClusterDraw" is set null if before the parent's start)                                                                    */
        if (false == ClusterBootUpDraw())
        {
            goto StartMain_ErrorEnd;
        }

        Status |= FlagBitStatus.VALID;

        /* Set Initial Animations */
        if (false == AnimationPlayInitial())
        {
            goto StartMain_ErrorEnd;
        }
        return;

        StartMain_ErrorEnd :;
        TableControlTrack = null;

        Status &= ~FlagBitStatus.VALID;
        return;
    }
Example #9
0
    private bool FontInitialize()
    {           /* MEMO: Solve between the cell (used by each font) and texture. */
        if (null == InstanceRoot)
        {
            return(false);
        }

        /* Create "Material-Table" */
        /* MEMO: Add Texture "Appendix" to Texture (used by "InstanceRoot"). */
        int CountTexture = (int)KindTexture.TERMINATOR;

        Texture2D[] TableTexture         = new Texture2D[CountTexture];
        Material    DataMaterialOriginal = InstanceRoot.MaterialGet((int)KindTexture.INNER, Library_SpriteStudio.KindColorOperation.MIX);

        TableTexture[(int)KindTexture.INNER] = (null != DataMaterialOriginal) ? ((Texture2D)(DataMaterialOriginal.mainTexture)) : null;
        TableTexture[(int)KindTexture.OUTER] = OutsideSSPJFontTexture;

        InstanceRoot.TableMaterialChange(Library_SpriteStudio.Utility.TableMaterial.Create(TableTexture));

        /* Prepare a table for each font */
        /* MEMO: I'm coding without using "Library_SpriteStudio.Utility.TableCell"-function. */
        /*       (To provide a sample for full-scratch "Cell-Table".)                        */
        int CountFont      = (int)Constant.FONT_MAX;
        int CountCharacter = (int)KindCharacter.TERMINATOR;

        ListCellTableFont = new Library_SpriteStudio.Control.CellChange[CountFont][][];
        Library_SpriteStudio.Control.CellChange[][] InstanceCellTableCellMap;
        Library_SpriteStudio.Data.CellMap           DataCellMap;
        for (int i = 0; i < CountFont; i++)
        {
            /* Create "Cell-Table" for a font. */
            /* MEMO: Set length of array to "1" because original SSAE-data is using only 1 Cell-Map. */
            InstanceCellTableCellMap = new Library_SpriteStudio.Control.CellChange[1][];
            ListCellTableFont[i]     = InstanceCellTableCellMap;

            Library_SpriteStudio.Control.CellChange[] InstanceCellTable = new Library_SpriteStudio.Control.CellChange[CountCharacter];
            InstanceCellTableCellMap[0] = InstanceCellTable;

            /* Get Cell-Map (in Animation-Data) */
            int IndexTexture = IndexTextures[i];

            DataCellMap = null; /* Value "Error" */
            if ((int)Constant.FONT_INSIDEPROJECT_MAX > i)
            {                   /* Default(inside Animation-Data) Cell-Map */
                if (null != InstanceRoot.DataCellMap)
                {
                    DataCellMap = InstanceRoot.DataCellMap.DataGetCellMap(0);
                }
            }
            else
            {                   /* Appendix(Outside Animation-Data) Cell-Map */
                if (null != OutsideSSPJFontCellMap)
                {
                    DataCellMap = OutsideSSPJFontCellMap.DataGetCellMap(0);
                }
            }

            /* Set Cell-Data (for the number of characters which is being used) */
            if (null != DataCellMap)
            {
                int IndexCell;
                Library_SpriteStudio.Data.Cell DataCell;
                for (int j = 0; j < CountCharacter; j++)
                {
                    /* Get original Cell-Data */
                    IndexCell = DataCellMap.IndexGetCell(NameCells[i][j]);
                    if (0 <= IndexCell)
                    {                           /* Valid */
                        DataCell = DataCellMap.DataGetCell(IndexCell);
                    }
                    else
                    {                           /* Not Found */
                        DataCell = null;
                    }

                    /* Set Cell-Data */
                    if (null != DataCell)
                    {                           /* Valid */
                        InstanceCellTable[j].DataSet(IndexTexture, DataCellMap, DataCell);
                    }
                    else
                    {                           /* Invalid */
                        InstanceCellTable[j].CleanUp();
                    }
                }
            }
            else
            {                   /* Error (Cell-Map is not Found) */
                for (int j = 0; j < CountCharacter; j++)
                {
                    /* Set "Invalid" to Cell */
                    InstanceCellTable[j].CleanUp();
                }
            }
        }

        return(true);
    }