Exemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
            var currentActive = selector.getActiveGameMapElement;

            if (currentActive != null)
            {
                //this.transform.position = current.transform.position;

                if (transform.parent != currentActive.transform)
                {
                    this.transform.SetParent(currentActive.transform);
                    currentMapFile = currentActive.GetComponent <GameMapElement>();
                }
                this.transform.localPosition = Vector3.zero;

                mask.alpha  = 1 - Mathf.Abs(transform.position.x * (1f / transform.lossyScale.x)) / range;
                arrow.alpha = mask.alpha;
                //mask.alpha = Mathf.Clamp(mask.alpha,minAlpha,maxAlpha);
                mask.alpha = curve.Evaluate(mask.alpha);
            }
            else
            {
                mask.alpha  = 0;
                arrow.alpha = 0;
            }
        }
Exemplo n.º 2
0
        public void onElementClick(GameMapElement tmfOb)
        {
            centerOnChild.CenterOn(tmfOb.transform);

            selector.getActiveGameMapElement = tmfOb;

            if (AudioClipPlayer.mode == AudioClipPlayer.PlayMode.none)
            {
                if (centerOnChild.onFinished == null)
                {
                    centerOnChild.onFinished += OnElementCentered;
                }
                else
                {
                    var list = centerOnChild.onFinished.GetInvocationList();
                    if (list == null || list.Length == 0)
                    {
                        centerOnChild.onFinished += OnElementCentered;
                    }
                }
            }
            //LoadAudio();
        }