Beispiel #1
0
    public override void Triggered()
    {
        if (colorTable.interactTable.Length <= 1 || m_CurrentTableIndex == colorTable.interactTable.Length - 1)
        {
            return;
        }

        m_CurrentColorTable = colorTable.interactTable[++m_CurrentTableIndex];
        UpdateColor();
    }
Beispiel #2
0
    void Start()
    {
#if UNITY_EDITOR
        if (!colorTable)
        {
            Debug.LogError($"[{gameObject.name}] Color table is not setted.");
            return;
        }
        else if (colorTable.interactTable.Length <= 0)
        {
            Debug.LogError($"[{gameObject.name}] Interact Color Table is must have at least 1 material.");
            return;
        }
#endif

        m_CurrentColorTable = colorTable.interactTable[0];
        UpdateColor();
    }