コード例 #1
0
ファイル: soul.cs プロジェクト: yuyuran/project
    void OnTriggerEnter(Collider other)
    {
        // SoulHitBox(tag=number)に当たった時
        if (other.gameObject.tag == "number")
        {
            // SoulHitBoxオブジェクトの一番上の親のスクリプトを取得
            numbers numberObj = other.gameObject.transform.GetComponent <numbers>();
            // 当たったナンバーが憑依されてないない & 魂も憑依していないなら
            if (/*!numberObj.GetCondition()&&*/ base.state == CONDITION.NORMAL)
            {
                // 憑依状態にする
                ///   soulConditionFlag = true;
                base.state = CONDITION.POSSESSION;

                // ナンバーの状態を憑依状態に
                numberObj.SetCondition(CONDITION.POSSESSION);

                // 取得した数字を保存
                number = other.gameObject;

                Debug.Log("憑依!");
                // ナンバーの回転角と一緒にする
                gameObject.transform.rotation = other.transform.rotation;

                // 当たった数字を子にする
                numberObj.transform.parent = gameObject.transform;


                // 憑依した時にカメラの位置を数字に適応させる(-1)
                Vector3 pos = new Vector3(other.transform.localPosition.x, other.transform.localPosition.y + 1.5f, other.transform.localPosition.z - 4);
            }
        }
    }
コード例 #2
0
ファイル: CreateItemButton.cs プロジェクト: yuyuran/project
    void OnEnable()
    {
        numberStatus             = number.GetComponent <numbers>();
        statusWindowItemDataBase = Camera.main.GetComponent <StatusWindowItemDataBase>();
        item = new GameObject[statusWindowItemDataBase.GetItemTotal()];

        // アイテムの総数分ボタン作成
        for (var i = 0; i < a; i++)
        {
            item[i]      = GameObject.Instantiate(itemPrefab) as GameObject;
            item[i].name = "Item" + i;
            // アイテムの親要素をこのスクリプトを持っているオブジェクトにする
            item[i].transform.SetParent(transform);
            // アイテムを持っているかどうか
            //if(numberStatus.GetItemFlag(i))
            //{
            //    Debug.Log(item[i].name);
            //    // アイテムデータベースの情報からスプライトを取得し、ボタンのスプライトに設定
            //    item[i].transform.GetComponent<Image>().sprite = statusWindowItemDataBase.GetItemDate()[i].GetItemSprite();
            //}
            //else
            //{
            //    // アイテムボタンのUI.Imageを不可視に。マウスやキーボードで操作不可
            //   // item[i].transform.GetChild(0).GetComponent<Image>().enabled = false;
            //   // item[i].transform.GetChild(0).GetComponent<Button>().interactable = false;
        }

        // ボタンに番号を設定
        // item[i].transform.GetChild(0).GetComponent<ItemButton>().SetItemNum(i);
    }
コード例 #3
0
        public override global::System.Data.DataSet Clone()
        {
            numbers cln = ((numbers)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
コード例 #4
0
        public IActionResult number()
        {
            numbers num = new numbers()
            {
                all = new int[] { 1, 2, 3 }
            };

            return(View(num));
        }
コード例 #5
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            numbers ds = new numbers();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
コード例 #6
0
        public IActionResult numbers()
        {
            messages messagesInController = new messages()
            {
                message = "lorem hasj kfsabbgasdfasdkjas hfkajshfkjsadhfkjashdfksakjh kj kjast fshtgthe noet aihi need ti inpeor ds as lkaj sgiashklvja sfgl afdgbdflkjgbsdlkfglksdfg"
            };


            numbers numberInController = new numbers()
            {
                number = new int [] { 5, 6, 3, 245, 435, 43, 234, 5 }
            };

            user thisOne = new user()
            {
                firstName = "nate",
                lastName  = "T"
            };
            user theOther = new user()
            {
                firstName = "tarik",
                lastName  = "Tjsbvkajsn"
            };


            users allOfTheUsers = new users()
            {
                theListofUsers = new List <user> {
                    thisOne, theOther
                }
            };



            allThem ViewModel = new allThem()
            {
                NewOne      = messagesInController,
                newNumbers  = numberInController,
                thisUser    = thisOne,
                allTheUsers = allOfTheUsers,
            };

            return(View(ViewModel));
        }
コード例 #7
0
        public ActionResult Create(numbers consulta, HttpPostedFileBase file, string page)
        {
            consulta.created       = DateTime.Now;
            consulta.updated       = DateTime.Now;
            consulta.bigNumber     = Request.Form["bigNumber"];
            consulta.suffix        = Request.Form["suffix"];
            consulta.txt           = Request.Form["txt"];
            consulta.status        = 1;
            consulta.page          = page;
            consulta.bigNumberBold = Convert.ToInt32(Request.Form["bigNumberBold"]);
            consulta.suffixBold    = Convert.ToInt32(Request.Form["suffixBold"]);
            consulta.txtBold       = Convert.ToInt32(Request.Form["txtBold"]);

            var ultimoitem    = new numbers();
            var consultaOrdem = (from ev in db.numbers orderby ev.position ascending select ev).ToList();

            if (consultaOrdem.Count() > 0)
            {
                ultimoitem        = consultaOrdem[consultaOrdem.Count - 1];
                consulta.position = ultimoitem.position + 1;
            }
            else
            {
                consulta.position = 1;
            }

            //Cadastra a Categoria.
            if (ModelState.IsValid)
            {
                //Save Post
                db.numbers.Add(consulta);
                db.SaveChanges();
                TempData["acao"] = "Dados inseridos com sucesso";
            }

            return(RedirectToAction("Index", "numbers", new { page = page }));
        }
コード例 #8
0
ファイル: Card.cs プロジェクト: gregfield/IN710-fielgm2
 //constructor sets the card suit and number to what is passed in
 public Card(int suit, int number)
 {
     this.suit = (suit)suit;
     this.numbers = (numbers)number;
 }
コード例 #9
0
ファイル: Card.cs プロジェクト: gregfield/IN710-fielgm2
 //constructor sets the card suit and number to what is passed in
 public Card(int suit, int number)
 {
     this.suit    = (suit)suit;
     this.numbers = (numbers)number;
 }
コード例 #10
0
ファイル: Program.cs プロジェクト: simple555a/DotNetAppDev
 ref var r       = ref Find(numbers, x => x > 4);
コード例 #11
0
    static void publish(int domain_id, int sample_count)
    {
        // --- Create participant --- //

        /* To customize participant QoS, use
         * the configuration file USER_QOS_PROFILES.xml */
        DDS.DomainParticipant participant =
            DDS.DomainParticipantFactory.get_instance().create_participant(
                domain_id,
                DDS.DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT,
                null /* listener */,
                DDS.StatusMask.STATUS_MASK_NONE);

        /* If you want to change the DomainParticipant's QoS programmatically
         * rather than using the XML file, you will need to add the following lines
         * to your code and comment out the create_participant call above.
         *
         * In this case, we set the transport settings in the XML by default, but
         * in the createParticipant call, we set up the transport
         * properties either using the Properties QoS in code.
         */
        /* DDS.DomainParticipant participant = createParticipant(domain_id); */

        if (participant == null)
        {
            shutdown(participant);
            throw new ApplicationException("create_participant error");
        }

        if (checkParticipant(participant) == true)
        {
            Console.WriteLine("Ok, recv_socket_buffer_size....modified");
            Console.WriteLine("Ok, send_socket_buffer_size....modified");
        }

        // --- Create publisher --- //

        /* To customize publisher QoS, use
         * the configuration file USER_QOS_PROFILES.xml */
        DDS.Publisher publisher = participant.create_publisher(
            DDS.DomainParticipant.PUBLISHER_QOS_DEFAULT,
            null /* listener */,
            DDS.StatusMask.STATUS_MASK_NONE);
        if (publisher == null)
        {
            shutdown(participant);
            throw new ApplicationException("create_publisher error");
        }

        // --- Create topic --- //

        /* Register type before creating topic */
        System.String type_name = numbersTypeSupport.get_type_name();
        try {
            numbersTypeSupport.register_type(
                participant, type_name);
        }
        catch (DDS.Exception e) {
            Console.WriteLine("register_type error {0}", e);
            shutdown(participant);
            throw e;
        }

        /* To customize topic QoS, use
         * the configuration file USER_QOS_PROFILES.xml */
        DDS.Topic topic = participant.create_topic(
            "Example numbers",
            type_name,
            DDS.DomainParticipant.TOPIC_QOS_DEFAULT,
            null /* listener */,
            DDS.StatusMask.STATUS_MASK_NONE);
        if (topic == null)
        {
            shutdown(participant);
            throw new ApplicationException("create_topic error");
        }

        // --- Create writer --- //

        /* To customize data writer QoS, use
         * the configuration file USER_QOS_PROFILES.xml */
        DDS.DataWriter writer = publisher.create_datawriter(
            topic,
            DDS.Publisher.DATAWRITER_QOS_DEFAULT,
            null /* listener */,
            DDS.StatusMask.STATUS_MASK_NONE);
        if (writer == null)
        {
            shutdown(participant);
            throw new ApplicationException("create_datawriter error");
        }
        numbersDataWriter numbers_writer =
            (numbersDataWriter)writer;

        // --- Write --- //

        /* Create data sample for writing */
        numbers instance = numbersTypeSupport.create_data();

        if (instance == null)
        {
            shutdown(participant);
            throw new ApplicationException(
                      "numbersTypeSupport.create_data error");
        }

        /* For a data type that has a key, if the same instance is going to be
         * written multiple times, initialize the key here
         * and register the keyed instance prior to writing */
        DDS.InstanceHandle_t instance_handle = DDS.InstanceHandle_t.HANDLE_NIL;

        /*
         * instance_handle = numbers_writer.register_instance(instance);
         */
        instance.number     = 1000;
        instance.halfNumber = (float)(instance.number) / 2;

        /* Main loop */
        const System.Int32 send_period = 4000; // milliseconds

        for (int count = 0;
             (sample_count == 0) || (count < sample_count);
             ++count)
        {
            Console.WriteLine("Writing numbers, count {0}", count);

            /* Modify the data to be sent here */


            try {
                numbers_writer.write(instance, ref instance_handle);
            }
            catch (DDS.Exception e) {
                Console.WriteLine("write error {0}", e);
            }
            instance.number     = (int)instance.halfNumber;
            instance.halfNumber = (float)(instance.number) / 2;

            System.Threading.Thread.Sleep(send_period);
        }

        /*
         * try {
         *  numbers_writer.unregister_instance(
         *      instance, ref instance_handle);
         * } catch(DDS.Exception e) {
         *  Console.WriteLine("unregister instance error: {0}", e);
         * }
         */

        // --- Shutdown --- //

        /* Delete data sample */
        try {
            numbersTypeSupport.delete_data(instance);
        } catch (DDS.Exception e) {
            Console.WriteLine(
                "numbersTypeSupport.delete_data error: {0}", e);
        }

        /* Delete all entities */
        shutdown(participant);
    }
コード例 #12
0
        public ActionResult Create()
        {
            var c = new numbers();

            return(View(c));
        }
コード例 #13
0
 // Start is called before the first frame update
 void Start()
 {
     number = GetComponent <numbers>();
 }
コード例 #14
0
ファイル: Program.cs プロジェクト: b-hailu/My-First-App
        public static void NumOne()
        {
            numbers N = new numbers();

            N.OneNum();
        }