コード例 #1
0
        void Start()
        {
            float timeToWaitInSec  = 2;
            float valueToBePrinted = 123456;

            // Create an ActionTimer with a primitive type.
            timer = new ActionTimer <float>(timeToWaitInSec, Test, valueToBePrinted);
            timer.Start(this);

            timerMyData = new ActionTimer <MyData>(3, 6, PrintMyData, new MyData(10, "teste", 654321, 'V'));
        }
コード例 #2
0
        void OnEnable()
        {
            if (text == null)
            {
                text = GetComponent <TextMesh>();
            }

            // First setup when enable. So the text doesn't come flying from "nowhere" to the character.
            transform.position = TargetPos + TextOffset;
            finalPos           = TargetPos + TextOffset + DistanceToCover;

            text.text  = DisplayText;
            text.color = StartColor;

            totalDist = Vector3.Distance(transform.position, finalPos);

            // Setup disable action.
            DisableTextAction = new ActionTimer <bool>(DecayTime, DecayTime, gameObject.SetActive, false);
            DisableTextAction.Start(this);
        }