// Use this for initialization
 void Start()
 {
     bloodFX = Bloodobject.GetComponent <BloodFX>();
     Zanim   = GetComponent <Animator>();
     if (!isEater)
     {
         DisableBoxColliders(this.transform);
     }
 }
예제 #2
0
 void Start()
 {
     _bloodFX = bloodFXObject.GetComponent <BloodFX>();
 }
예제 #3
0
    public override void OnInspectorGUI()
    {
        m_object.Update();
        DrawDefaultInspector();

        BloodFX _2dxScript = (BloodFX)target;



        //Texture2D icon = Resources.Load("2dxfxinspector-anim") as Texture2D;
        //if (icon)
        //{
        //    Rect r;
        //    float ih = icon.height;
        //    float iw = icon.width;
        //    float result = ih / iw;
        //    float w = Screen.width;
        //    result = result * w;
        //    r = GUILayoutUtility.GetRect(ih, result);
        //    EditorGUI.DrawTextureTransparent(r, icon);
        //}

        EditorGUILayout.PropertyField(m_object.FindProperty("ActiveUpdate"), new GUIContent("Active Update", "Active Update, for animation / Animator only")); EditorGUILayout.PropertyField(m_object.FindProperty("ForceMaterial"), new GUIContent("Shared Material", "Use a unique material, reduce drastically the use of draw call"));

        if (_2dxScript.ForceMaterial == null)
        {
            _2dxScript.ActiveChange = true;
        }
        else
        {
            if (GUILayout.Button("Remove Shared Material"))
            {
                _2dxScript.ForceMaterial = null;
                _2dxScript.ShaderChange  = 1;
                _2dxScript.ActiveChange  = true;
                _2dxScript.CallUpdate();
            }

            EditorGUILayout.PropertyField(m_object.FindProperty("ActiveChange"), new GUIContent("Change Material Property", "Change The Material Property"));
        }

        if (_2dxScript.ActiveChange)
        {
            EditorGUILayout.BeginVertical("Box");

            Texture2D icone = Resources.Load("2dxfx-icon-distortion") as Texture2D;
            EditorGUILayout.PropertyField(m_object.FindProperty("TurnToBlood"), new GUIContent("Turn To Blood", icone, "Turn to Blood = 0 = normal sprite : 1 = Blood Liquified"));
            icone = Resources.Load("2dxfx-icon-time") as Texture2D;
            EditorGUILayout.PropertyField(m_object.FindProperty("Blood"), new GUIContent("Blood Distortion", icone, "Change the distortion of the blood"));

            EditorGUILayout.BeginVertical("Box");

            icone = Resources.Load("2dxfx-icon-fade") as Texture2D;
            EditorGUILayout.PropertyField(m_object.FindProperty("_Alpha"), new GUIContent("Fading", icone, "Fade from nothing to showing"));

            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
        }

        m_object.ApplyModifiedProperties();
    }