Tanoda
ReceiverScript_Example.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
10using System.Collections;
11using System.Collections.Generic;
12using UnityEngine;
13
14public class ReceiverScript_Example : MonoBehaviour {
15
16 private Material _materialInstance;
17
18 [EditTimeOnly, SerializeField]
19 private Color _currentColor;
21 get { return _currentColor; }
22 set {
23 if (_materialInstance != null) {
24 _materialInstance.color = value;
25 _currentColor = value;
26 }
27 }
28 }
29
30 private void Start() {
31 _materialInstance = GetComponent<Renderer>().material;
32 currentColor = Color.white;
33 }
34
35 public void SetColorEvent(object colorArg) {
36 currentColor = (Color)colorArg;
37 }
38
39}
UnityEngine.Color Color
Definition: TestScript.cs:32
void SetColorEvent(object colorArg)