Exemplo n.º 1
0
 void OnReceiveSignalA(SignalA a)
 {
     Pool.Spawn(PoolPrefab);
 }
Exemplo n.º 2
0
        public void Update()
        {
            Vector2 offset;

            if (Channel == ChannelE.A)
            {
                if (!signalTextureOffsets.TryGetValue(SignalA, out offset))
                {
                    throw new System.ApplicationException(string.Format("Scope.Update: key not found in signalTextureOffsets dictionary: {0}", SignalA.ToString()));
                }
            }
            else
            {
                if (!signalTextureOffsets.TryGetValue(SignalB, out offset))
                {
                    throw new System.ApplicationException(string.Format("Scope.Update: key not found in signalTextureOffsets dictionary: {0}", SignalB.ToString()));
                }
            }

            if (Day)
            {
                rendererSignalDay.material.SetTextureOffset("_MainTex", offset);

                if (Channel == ChannelE.A)
                {
                    rendererBackgroundDayA.gameObject.SetActive(true);
                    rendererBackgroundDayB.gameObject.SetActive(false);
                }
                else
                {
                    rendererBackgroundDayA.gameObject.SetActive(false);
                    rendererBackgroundDayB.gameObject.SetActive(true);
                }
                rendererBackgroundNight.gameObject.SetActive(false);
                rendererSignalDay.gameObject.SetActive(true);
                rendererSignalNight.gameObject.SetActive(false);
            }
            else
            {
                rendererSignalNight.material.SetTextureOffset("_MainTex", offset);

                rendererBackgroundDayA.gameObject.SetActive(false);
                rendererBackgroundDayB.gameObject.SetActive(false);
                rendererBackgroundNight.gameObject.SetActive(true);
                rendererSignalDay.gameObject.SetActive(false);
                rendererSignalNight.gameObject.SetActive(true);
            }
        }
Exemplo n.º 3
0
 void GetSignalA(SignalA signal)
 {
     Debug.Log(signal.msg);
 }