Beispiel #1
0
    void Awake()
    {
        Instance       = this;
        spriteRenderer = GetComponent <SpriteRenderer>();

        //We modify the name as quickly as possible
        prefix = characterName.ToUpper() + '_' + Enum.GetName(typeof(CHANGEFOR), changeFor);
    }
Beispiel #2
0
    static bool ValidatePosesAndChange(string value, ref bool _notFlag)
    {
        //Check if a key matches
        string data = STRINGNULL;

        if (PARSER.DefinedExpressions.ContainsKey(value))
        {
            if (value.GetType() == typeof(string))
            {
                data     = FindKey(value, PARSER.DefinedPoses);
                _notFlag = false;
            }
        }

        else if (PARSER.DefinedExpressions.ContainsValue(Convert.ToInt32(value)))
        {
            if (Convert.ToInt32(value).GetType() == typeof(int))
            {
                data = FindValueAndConvertToKey(Convert.ToInt32(value), PARSER.DefinedPoses);

                _notFlag = false;
            }
        }

        if (_notFlag)
        {
            //Otherwise, we'll through an error saying this hasn't been defined.
            Debug.LogError(value + " has not been defined. Perhaps declaring it in the associated " + dslFileExtention + " File.");
            return(FAILURE);
        }

        //We get the name, keep if it's EXPRESSION or POSE, and the emotion value
        string characterName  = data.Split('_')[0];
        string changeType     = data.Split('_')[1];
        string characterState = data.Split('_')[2];

        Debug.Log(characterState);

        //Now we see if we can grab the image, and have it change...
        DialogueSystemSpriteChanger changer = Find_Sprite_Changer(characterName + "_" + changeType);

        changer.CHANGE_IMAGE(characterState);

        ShiftCursorPosition(-1);

        return(SUCCESSFUL);
    }