Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static Judge getInstance()
 {
     if (_instance == null)
     {
         _instance = new Judge();
     }
     return(_instance);
 }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 6
0
        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);
                }
            }
        }
Exemplo n.º 7
0
 private void Start()
 {
     action    = Director.getInstance().currentSceneController as IUserAction;
     judgement = Judge.getInstance();
 }
Exemplo n.º 8
0
 void Start()
 {
     judgement = Judge.getInstance();
 }