やまめも

【 ゲーム開発・日々のことについて 】

配列、要素の位置

[列、行]

using UnityEngine;
using System.Collections;

public class SituationManager : MonoBehaviour {
	public Animator anim;
	private string[,] myAnimList = {
		{"Hostage_0_0","Hostage_0_1","Hostage_0_2"},
		{"Hostage_1_0","Hostage_1_1","Hostage_1_2"},
		{"Hostage_2_0","Hostage_2_1","Hostage_2_2"},
		{"Hostage_3_0","Hostage_3_1","Hostage_3_2"},
		{"Bandit_0_0","Bandit_0_1","Bandit_0_2"},
		{"Bandit_1_0","Bandit_1_1","Bandit_1_2"},
		{"Bandit_2_0","Bandit_2_1","Bandit_2_2"},
		{"Empty_0_0","Empty_0_1","Idle"}
	};
	public static SituationManager instance = null;
	void Awake(){
		if( instance == null){
			instance = this;
		}
	}
	public void HostageIdle(int value){
		anim.Play(myAnimList[value,0]);
	}
	public void HostageCorrect(int value){
		anim.Play(myAnimList[value,1]);
	}
	public void HostageIncorrect(int value){
		anim.Play(myAnimList[value,2]);
	}
	public void BanditIdle(int value){
		anim.Play(myAnimList[value,0]);
	}
	public void BanditCorrect(int value){
		anim.Play(myAnimList[value,1]);
	}
	public void BanditIncorrect(int value){
		anim.Play(myAnimList[value,2]);
	}
	public void EmptyIdle(int value){
		anim.Play(myAnimList[value,0]);
	}
	public void Empty(int value){
		anim.Play(myAnimList[value,1]);
	}
	public void Idle(int value){
		anim.Play(myAnimList[value,2]);
	}
}