コード例 #1
0
        void CollectPointOfInterest(Collider2D collider)
        {
            PointOfInterest poi = collider.gameObject.GetComponent <PointOfInterest>();

            if (poi == null)
            {
                return;
            }
            // Add time
            float?timeValue = poi?.GetTimeValue();

            if (timeValue.HasValue)
            {
                //Debug.Log("Collecting!");
                // Actually add the time to the overall counter
            }
            // Delay input
            m_bonusTimeValue = timeValue.Value / actionTime;
            FreezeInput(actionTime, true);
            FindObjectOfType <CountDownTimer> ().AddPickUp(1, Player1);

            Destroy(Instantiate(DrillIcon, transform.position + new Vector3(0.0f, 0.25f, 0f), Quaternion.identity), actionTime);

            // Disable collision on point of interest
            poi?.EnableSelfDestruction(actionTime);
        }