public override void OnEnable()
        {
            if (target == null) {
            return;
            }

            base.OnEnable();

            script = target as TransformRenderer3D;

            objectTexture = serializedObject.FindProperty("objectTexture");
            objectAtlasTextureGUID = serializedObject.FindProperty("objectAtlasTextureGUID");

            objectTint = serializedObject.FindProperty("objectTint");

            objectAnchor = serializedObject.FindProperty("objectAnchor");

            transformTranslate = serializedObject.FindProperty("transformTranslate");
            transformRotate = serializedObject.FindProperty("transformRotate");
            transformScale = serializedObject.FindProperty("transformScale");

            translateFunctionStart = serializedObject.FindProperty("translateFunction")
            .FindPropertyRelative("startPosition");
            translateFunctionEnd = serializedObject.FindProperty("translateFunction")
            .FindPropertyRelative("endPosition");
            rotateFunctionStart = serializedObject.FindProperty("rotateFunction")
            .FindPropertyRelative("startAngle");
            rotateFunctionEnd = serializedObject.FindProperty("rotateFunction")
            .FindPropertyRelative("endAngle");
            scaleFunctionStart = serializedObject.FindProperty("scaleFunction")
            .FindPropertyRelative("startScale");
            scaleFunctionEnd = serializedObject.FindProperty("scaleFunction")
            .FindPropertyRelative("endScale");
        }
Exemplo n.º 2
0
    public override void OnEnable() {
        if (target == null) {
            return;
        }

        base.OnEnable();

        script = target as TransformRenderer3D;

        objectTexture = serializedObject.FindProperty("objectTexture");
        objectAtlasTextureGUID = serializedObject.FindProperty("objectAtlasTextureGUID");

        objectTint = serializedObject.FindProperty("objectTint");

        objectAnchor = serializedObject.FindProperty("objectAnchor");

        transformTranslate = serializedObject.FindProperty("transformTranslate");
        transformRotate = serializedObject.FindProperty("transformRotate");
        transformScale = serializedObject.FindProperty("transformScale");

        translateFunctionStart = serializedObject.FindProperty("translateFunction")
            .FindPropertyRelative("startPosition");
        translateFunctionEnd = serializedObject.FindProperty("translateFunction")
            .FindPropertyRelative("endPosition");
        rotateFunctionStart = serializedObject.FindProperty("rotateFunction")
            .FindPropertyRelative("startAngle");
        rotateFunctionEnd = serializedObject.FindProperty("rotateFunction")
            .FindPropertyRelative("endAngle");
        scaleFunctionStart = serializedObject.FindProperty("scaleFunction")
            .FindPropertyRelative("startScale");
        scaleFunctionEnd = serializedObject.FindProperty("scaleFunction")
            .FindPropertyRelative("endScale");
    }
Exemplo n.º 3
0
    static void TryApplyExampleTextures(TransformRenderer3D bar) {
        var objectTexture = AssetDatabase.LoadAssetAtPath(
            "Assets/Energy Bar Toolkit/Example/Textures/ClockBar/object.png", typeof(Texture2D)) as Texture2D;
        var bgTexture = AssetDatabase.LoadAssetAtPath(
            "Assets/Energy Bar Toolkit/Example/Textures/ClockBar/bg.png", typeof(Texture2D)) as Texture2D;

        if (objectTexture != null && bgTexture != null) {
            bar.objectTexture = objectTexture;
            bar.texturesBackground = new EnergyBarBase.Tex[] { new EnergyBarBase.Tex() { texture = bgTexture, color = Color.white } };

            bar.transformRotate = true;
            bar.rotateFunction.endAngle = 360;

        } else {
            Debug.LogWarning("Failed to locate example textures. This is not something bad, but have you changed "
                             + "your Energy Bar Toolkit directory location?");
        }
    }
    static void TryApplyExampleTextures(TransformRenderer3D bar) {
        var objectTexture = AssetDatabase.LoadAssetAtPath(
            AssetDatabase.GUIDToAssetPath("523f18576f6c0fb4dbe3d54cc4c0b819"), typeof(Texture2D)) as Texture2D;
        var bgTexture = AssetDatabase.LoadAssetAtPath(
            AssetDatabase.GUIDToAssetPath("36004bc17f3a2334c9aaa63e652d26d6"), typeof(Texture2D)) as Texture2D;

        if (objectTexture != null && bgTexture != null) {
            bar.objectTexture = objectTexture;
            bar.texturesBackground = new EnergyBarBase.Tex[] { new EnergyBarBase.Tex() { texture = bgTexture, color = Color.white } };

            bar.transformRotate = true;
            bar.rotateFunction.endAngle = 360;

        } else {
            Debug.LogWarning("Failed to locate example textures. This is not something bad, but have you changed "
                             + "your Energy Bar Toolkit directory location?");
        }
    }
Exemplo n.º 5
0
    static void TryApplyExampleTextures(TransformRenderer3D bar) {
        var objectTexture = AssetDatabase.LoadAssetAtPath(
            AssetDatabase.GUIDToAssetPath("523f18576f6c0fb4dbe3d54cc4c0b819"), typeof(Texture2D)) as Texture2D;
        var bgTexture = AssetDatabase.LoadAssetAtPath(
            AssetDatabase.GUIDToAssetPath("36004bc17f3a2334c9aaa63e652d26d6"), typeof(Texture2D)) as Texture2D;

        if (objectTexture != null && bgTexture != null) {
            bar.objectTexture = objectTexture;
            bar.texturesBackground = new EnergyBarBase.Tex[] { new EnergyBarBase.Tex() { texture = bgTexture, color = Color.white } };

            bar.transformRotate = true;
            bar.rotateFunction.endAngle = 360;

        } else {
            Debug.LogWarning("Failed to locate example textures. This is not something bad, but have you changed "
                             + "your Energy Bar Toolkit directory location?");
        }
    }