Skip to content

prathmeshbhosle1617-ops/UnityCsReference

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

245 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

using UnityEngine; using UnityEngine.UI;

public class GiftFall : MonoBehaviour { public float fallSpeed = 2.0f; public GameObject sparkleEffect; public Text messageText;

private bool hasLanded = false;

void Start()
{
    messageText.text = "Raksha Bandhan Gift Coming...";
}

void Update()
{
    if (!hasLanded)
    {
        transform.position += Vector3.down * fallSpeed * Time.deltaTime;

        if (transform.position.y <= 0.5f)
        {
            hasLanded = true;
            Instantiate(sparkleEffect, transform.position, Quaternion.identity);
            messageText.text = "Gift Arrived! 💝";
        }
    }
}

}

About

Unity C# reference source code.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C# 100.0%