Beispiel #1
0
 public SideEffect(SideEffect effect)
 {
     m_effectIdentifier = effect.m_effectIdentifier;
     m_prefab           = effect.m_prefab;
     m_effectPos        = effect.m_effectPos;
     m_effectSound      = effect.m_effectSound;
     m_volume           = effect.m_volume;
     m_loopSound        = effect.m_loopSound;
     m_useType          = effect.m_useType;
     m_isPermanent      = effect.m_isPermanent;
     m_duration         = effect.m_duration;
     m_ticks            = effect.m_ticks;
 }
Beispiel #2
0
    public virtual int DrawEffect(int xPos, int yPos, GUISkin skin)
    {
        //int initPos = yPos;
#if UNITY_EDITOR
        EditorGUI.LabelField(new Rect(xPos + 150, yPos += 20, 150, 20), m_effectIdentifier, skin.label);
        EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("SideEffect Identifier: "), skin.label);

        m_prefab = EditorGUI.TextField(new Rect(xPos + 150, yPos += 20, 150, 20), m_prefab, skin.textField);
        EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Effect Prefab Name: "), skin.label);

        m_effectSound = EditorGUI.TextField(new Rect(xPos + 150, yPos += 20, 150, 20), m_effectSound, skin.textField);
        EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Side Effect Sound: "), skin.label);

        m_volume = EditorGUI.IntSlider(new Rect(xPos + 150, yPos += 20, 150, 20), m_volume, 0, 100);
        EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Effect Sound Volume"), skin.label);

        m_loopSound = EditorGUI.Toggle(new Rect(xPos + 150, yPos += 20, 150, 20), m_loopSound);
        EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Effect Sound Volume"), skin.label);

        m_effectPos = (EEntityTransform)EditorGUI.EnumPopup(new Rect(xPos + 150, yPos += 20, 150, 20), m_effectPos);
        EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Launch Effect Pos: "), skin.label);

        m_useType = (EUseType)EditorGUI.EnumPopup(new Rect(xPos + 150, yPos += 20, 150, 20), m_useType);
        EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Use Type: "), skin.label);

        switch (m_useType)
        {
        case EUseType.Timed:
            m_duration = EditorGUI.FloatField(new Rect(xPos + 150, yPos += 20, 200, 20), m_duration);
            EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Effect Duration: "), skin.label);
            break;

        case EUseType.Ticks:
            m_ticks = EditorGUI.IntField(new Rect(xPos + 150, yPos += 20, 200, 20), m_ticks);
            EditorGUI.LabelField((new Rect(xPos, yPos, 180, 20)), new GUIContent("Effect Ticks: "), skin.label);
            break;

        case EUseType.Permanent:
            break;

        default:
            break;
        }

        EditorUtility.SetDirty(this);
#endif
        return(yPos);
    }