public override void OnInspectorGUI() { AutoTile autoTile = (AutoTile)target; DrawDefaultInspector(); if (GUILayout.Button("Update")) { autoTile.UpdateState(); } }
void NotificateChange(int x, int y) { if (x < 0 || y < 0 || x >= width || y >= height) { return; } Node node = nodeMap[x, y]; GameObject block = node.GetBlock(); if (!block) { return; } AutoTile autoTile = block.GetComponent <AutoTile>() as AutoTile; if (autoTile == null) { return; } autoTile.UpdateState(); }