Exemple #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        // sets the target to the pokeball
        ConfettiScript pokeball = (ConfettiScript)target;

        // puts the first button on the right
        GUILayout.BeginHorizontal();

        // change color in editor before start
        if (GUILayout.Button("Generate Color"))
        {
            pokeball.GenerateColor();
        }
        // reset color in editor before start
        if (GUILayout.Button("Reset"))
        {
            pokeball.Reset();
        }

        // puts the second button on the left
        GUILayout.EndHorizontal();
    }
 void Start()
 {
     rb = GetComponent<Rigidbody> ();
     rend = GetComponent<Renderer> ();
     trail = GetComponent<TrailRenderer>();
     trail.material.color = rend.material.color;
     asplode = GetComponent<ParticleSystem> ();
     //scoreboard = FindObjectOfType ;
     ownNumber = 0;
     sploded = false;
     victoryEffect = GetComponentInChildren<ConfettiScript>();
 }