Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Display the elements in an array one at a time using getkeydown in unity

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class LoadImage : MonoBehaviour {

[SerializeField] private Image newImage;
[SerializeField] Image[] nextImage;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
    GetNextImage();
} 

private Image GetNextImage()
{
    if (Input.GetKeyDown(KeyCode.RightArrow))
    {
        for (int i = 0; i < nextImage.Length; i++)
        {
            newImage = nextImage[i];
            newImage.enabled = true;
        }
    }
    return newImage;
}
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: closedxm Iworksheet excel formulal 
Csharp :: return a list of list from yaml via C# 
Csharp :: "; expected" error c#$ 
Csharp :: Focus on last entry in listbox 
Csharp :: Unity FPS camera z axis rotating problem 
Csharp :: how to refrence a variable from other script in c# 
Csharp :: c# read single key 
Csharp :: shell32.dll c# example 
Csharp :: c# one dimensional dictionary 
Csharp :: c# order by descending on 2 values 
Csharp :: c# with keyword 
Csharp :: nest elasticsearch date reange c# .net 
Csharp :: c# find the smallest string in an array of strings 
Csharp :: how to start commvault services on linux 
Csharp :: c# cosmos db add items into container 
Csharp :: difference between c# and .net 
Csharp :: get current culture in controller asp.net core 
Csharp :: binaural generator 
Csharp :: esc exit winform 
Csharp :: trimend c# 
Csharp :: single number c# 
Csharp :: c sharp if statements 
Csharp :: how to handle array getter setter in c# of string type 
Csharp :: access form in a folder C# 
Csharp :: button pervious for picturebox c# 
Csharp :: plays ervices unity sigin 
Csharp :: how to modigy login page asp.net core 
Csharp :: k8s You must be logged in to the server (Unauthorized) 
Csharp :: grab reference from method parameter c# 
Csharp :: how to make a draggable visual studio panel 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =