Tanoda
CustomChannelFeatureBase.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using System;
10using UnityEngine;
12
14
15 public interface ICustomChannelFeature {
16 string channelName { get; }
17 }
18
19 [Serializable]
21 where T : LeapFeatureData, new() {
22
23 [Tooltip("The name of the channel. This is the name used to access the channel from within the shader.")]
24 [Delayed]
26 [SerializeField]
27 private string _channelName = "_CustomChannel";
28
29 public string channelName {
30 get {
31 return _channelName;
32 }
33 }
34
36 foreach (var feature in group.features) {
37 if (feature == this) continue;
38
39 var channelFeature = feature as ICustomChannelFeature;
40 if (channelFeature != null && channelFeature.channelName == channelName) {
41 return SupportInfo.Error("Cannot have two custom channels with the same name.");
42 }
43 }
44
45 return SupportInfo.FullSupport();
46 }
47 }
48}
override SupportInfo GetSupportInfo(LeapGraphicGroup group)
The support info class provides a very basic way to notify that something is fully supported,...
Definition: SupportInfo.cs:21
static SupportInfo Error(string message)
Helper getter to return a struct that signifies no support with an error message.
Definition: SupportInfo.cs:42
static SupportInfo FullSupport()
Helper getter to return a struct that signifies full support.
Definition: SupportInfo.cs:28