Skip to content

Instantly share code, notes, and snippets.

@aki017
Created April 22, 2015 03:49
Show Gist options
  • Save aki017/8df66b2bb7437896c2ce to your computer and use it in GitHub Desktop.
Save aki017/8df66b2bb7437896c2ce to your computer and use it in GitHub Desktop.
using UnityEngine;
public class ng : MonoBehaviour
{
public GameObject prefab;
private GameObject go;
private bool Flag = false;
void Start ()
{
}
void Update ()
{
if ((false == Flag)) {
go = (GameObject)Instantiate(prefab);
go.transform.parent = transform;
// 実際にはその場面に応じて変わる
var animeNo = 0;
go.GetComponentInChildren<Script_SpriteStudio_PartsRoot>().AnimationPlay(animeNo);
Flag = true;
}
}
}
using UnityEngine;
public class ok : MonoBehaviour
{
public GameObject prefab;
private GameObject go;
private bool Flag = false;
void Start ()
{
go = (GameObject)Instantiate(prefab);
go.transform.parent = transform;
}
void Update ()
{
if ((false == Flag)) {
// 実際にはその場面に応じて変わる
var animeNo = 0;
go.GetComponentInChildren<Script_SpriteStudio_PartsRoot>().AnimationPlay(animeNo);
Flag = true;
}
}
}
@aki017
Copy link
Author

aki017 commented Apr 22, 2015

NullReferenceException: Object reference not set to an instance of an object
Script_SpriteStudio_PartsRoot.AnimationPlay (Int32 No, Int32 TimesPlay, Int32 FrameInitial, Single RateTime, PlayStyle KindStylePlay, System.String LabelStart, Int32 FrameOffsetStart, System.String LabelEnd, Int32 FrameOffsetEnd) (at Assets/SpriteStudio/Script/Script_SpriteStudio_PartsRoot.cs:983)
ng.Update () (at Assets/ng.cs:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment