public GameObject getUFO(int round) { GameObject need; if (isFree.Count <= 0) { need = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/UFO"), ruler.getStart(), Quaternion.identity) as GameObject; need.AddComponent <UFO>(); Rigidbody rigidbody = need.AddComponent <Rigidbody>(); rigidbody.useGravity = false; } else { need = isFree[0]; isFree.Remove(need); } isInuse.Add(need); int index = ruler.getColor(); Material material = UnityEngine.Object.Instantiate(Resources.Load <Material>("Materials/" + Enum.GetName(typeof(Ruler.Color), index))); need.GetComponent <MeshRenderer>().material = material; UFO ufo = need.GetComponent <UFO>(); ufo.setScale(ruler.getScale(Judge.getInstance().getRound())); need.transform.position = ruler.getStart(); ufo.setDespos(ruler.getDes(need.transform.position)); ufo.setScore(index + 1); return(need); }
public static Judge getInstance() { if (_instance == null) { _instance = new Judge(); } return(_instance); }
public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Competeted, int intParam = 0, string strParam = null) { UFO ufo = source.gameobject.GetComponent <UFO>(); if (!ufo.isClicked) { Judge.getInstance().subScore(ufo.score); } UFOFactory.getInstance().free(source.gameobject); }
void Awake() { Director director = Director.getInstance(); director.setFPS(60); director.currentSceneController = this; judgement = Judge.getInstance(); loadInitSetting(); this.gameObject.AddComponent <UserGUI>(); actionManager = this.gameObject.AddComponent <SSActionManager>(); this.gameObject.AddComponent <checkClick>(); director.currentSceneController.LoadResources(); }
void Awake() { Debug.Log("Awake"); Director director = Director.getInstance(); director.setFPS(60); director.currentSceneController = this; judgement = Judge.getInstance(); loadInitSetting(); this.gameObject.AddComponent <UserGUI>(); if (ModeChoose.getInstance().ifPhysic()) { if (this.gameObject.GetComponent <SSActionManager>() != null) { Destroy(this.gameObject.GetComponent <SSActionManager>()); } if (this.gameObject.GetComponent <PhysicActionManager>() == null) { actionManager = this.gameObject.AddComponent <PhysicActionManager>(); Debug.Log("new py"); } } else { if (this.gameObject.GetComponent <PhysicActionManager>() != null) { Destroy(this.gameObject.GetComponent <PhysicActionManager>()); } if (this.gameObject.GetComponent <SSActionManager>() == null) { actionManager = this.gameObject.AddComponent <SSActionManager>(); Debug.Log("new ss"); } } actionManager.setCallback(this); if (this.gameObject.GetComponent <checkClick>() == null) { this.gameObject.AddComponent <checkClick>(); } director.currentSceneController.LoadResources(); }
public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Competeted, int intParam = 0, string strParam = null) { UFO ufo = source.gameobject.GetComponent <UFO>(); if (!ufo.isClicked) { Judge.getInstance().subScore(ufo.score); } UFOFactory.getInstance().free(source.gameobject); runSequence.Remove(source); if (runSequence.Count <= 0) { if (this.callback != null) { this.callback.SSActionEvent(source); } } }
private void Start() { action = Director.getInstance().currentSceneController as IUserAction; judgement = Judge.getInstance(); }
void Start() { judgement = Judge.getInstance(); }