public Pad(string name, PadDirection direction) : base(IntPtr.Zero)
        {
            IntPtr native_name = OldGLib.Marshaller.StringToPtrGStrdup(name);

            raw = gst_pad_new(native_name, direction);
            OldGLib.Marshaller.Free(native_name);
        }
Exemple #2
0
    void Start()
    {
        //오브젝트 받아오기
        rb = GetComponent <Rigidbody2D>();
        bottleGenerator          = GameObject.Find("BottleManager").GetComponent <BottleGenerator>();
        player                   = GameObject.Find("Player");
        bottleSelectController   = GameObject.Find("BottleManager").GetComponent <BottleSelectController>();
        playerImageController    = player.GetComponent <PlayerImageController>();
        padStrength              = GameObject.Find("Pad_Strength").GetComponent <PadStrength>();
        padDirection             = GameObject.Find("Joystick").GetComponent <PadDirection>();
        trajectoryLine           = GameObject.Find("Trajectory").GetComponent <TrajectoryLine>();
        transparent              = GetComponent <SpriteRenderer>(); // 물병의 스프라이트 렌더러(투명도)
        tensionGaugeManager      = GameObject.Find("Image_TensionGaugeBar").GetComponent <TensionGaugeManager>();
        controllButtonsUIManager = GameObject.Find("UIManager").GetComponent <ControllButtonsUIManager>();
        usefullOperation         = GameObject.Find("GameResource").GetComponent <UsefullOperation>();
        screenEffectController   = GameObject.Find("Main Camera").GetComponent <ScreenEffectController>();;


        //값 초기화
        rb.gravityScale      = 0;
        transform.position   = playerImageController.getBottlePosition();
        isSuperPowerAvailabe = false; //물병에 초능력을 적용할 수 있는지의 여부
        isStanding           = false;
        onFloor             = false;
        standingBySkill     = false;
        rotateSpeed         = 0.8f; //회전속도
        delta               = 0;
        destroyDelay        = 1;
        standingDelay       = 2;
        padStrengthTouched  = false;
        padDirectionTouched = false;
        tensionGaugeUp      = true;
        isDestroying        = false;
        standBottle         = false;
    }
 public Pad(string name, PadDirection direction)
     : base(IntPtr.Zero)
 {
     IntPtr native_name = OldGLib.Marshaller.StringToPtrGStrdup (name);
     raw = gst_pad_new (native_name, direction);
     OldGLib.Marshaller.Free (native_name);
 }
Exemple #4
0
 // Start is called before the first frame update
 void Start()
 {
     playerImageController  = GameObject.Find("Player").GetComponent <PlayerImageController>();
     padStrength            = GameObject.Find("Pad_Strength").GetComponent <PadStrength>();
     padDirection           = GameObject.Find("Joystick").GetComponent <PadDirection>();
     skillButton            = GameObject.Find("Button_Skill").GetComponent <SkillButton>();
     bottleSelectController = GameObject.Find("BottleManager").GetComponent <BottleSelectController>();
 }
 private void Start()
 {
     recentPos         = transform.position;
     glowingEffect     = gameObject.transform.Find("GlowingEffect").gameObject;
     padDirection      = GameObject.Find("Joystick").GetComponent <PadDirection>();
     usefullOperation  = GameObject.Find("GameResource").GetComponent <UsefullOperation>();
     membraneDirection = new Vector3(0, 1, 0);
     startDelta        = false;
     destroyDelta      = 20;
 }
Exemple #6
0
    void Start()
    {
        initPos        = gameObject.transform.position;
        rigidbody      = GetComponent <Rigidbody2D>();
        trajectoryDots = new GameObject[trajectoryNumber];

        padDirection           = GameObject.Find("Joystick").GetComponent <PadDirection>();
        rigidbody.gravityScale = 0;
        rotateSpeed            = 300;

        for (int i = 0; i < trajectoryNumber; i++)
        {
            trajectoryDots[i] = Instantiate(trajectoryDot, gameObject.transform);
        }
    }
Exemple #7
0
    public Sprite[] skillButtonSprite; // skill버튼 스프라이트 배열

// Start is called before the first frame update
    void Start()
    {
        tensionGaugeBar          = GameObject.Find("Image_TensionGaugeBar");
        panel_SuperPower         = GameObject.Find("Panel_SuperPower");
        membranes                = GameObject.Find("Membranes");
        trajectory               = GameObject.Find("Trajectory");
        button                   = GetComponent <Button>();
        playerImageController    = GameObject.Find("Player").GetComponent <PlayerImageController>();
        bottleSelectController   = GameObject.Find("BottleManager").GetComponent <BottleSelectController>();
        padStrength              = GameObject.Find("Pad_Strength").GetComponent <PadStrength>();
        padDirection             = GameObject.Find("Joystick").GetComponent <PadDirection>();
        tensionGaugeManager      = GameObject.Find("Image_TensionGaugeBar").GetComponent <TensionGaugeManager>();
        controllButtonsUIManager = GameObject.Find("UIManager").GetComponent <ControllButtonsUIManager>();
        psychokinesis            = GameObject.Find("Player").GetComponent <Psychokinesis>();
        freezer                  = GameObject.Find("Player").GetComponent <Freezer>();
        usingSkill               = false;
        skillUsed                = false;
    }
    void Start()
    {
        playingChr    = 0;
        firstSlotChr  = 1;
        secondSlotChr = 2;

        spriteRenderer         = GetComponent <SpriteRenderer>();
        bottleSelectController = GameObject.Find("BottleManager").GetComponent <BottleSelectController>();
        skillButton            = GameObject.Find("Button_Skill").GetComponent <SkillButton>();
        padStrength            = GameObject.Find("Pad_Strength").GetComponent <PadStrength>();
        padDirection           = GameObject.Find("Joystick").GetComponent <PadDirection>();
        charSlot1       = GameObject.Find("ControllButtons").transform.Find("Button_CharacterSlot_1").GetComponent <Image>();
        charSlot2       = GameObject.Find("ControllButtons").transform.Find("Button_CharacterSlot_2").GetComponent <Image>();
        characterSlot_1 = GameObject.Find("ControllButtons").transform.Find("Button_CharacterSlot_1").GetComponent <Button>();
        characterSlot_2 = GameObject.Find("ControllButtons").transform.Find("Button_CharacterSlot_2").GetComponent <Button>();

        characterSlot_1.onClick.AddListener(CharacterSlot1);
        characterSlot_2.onClick.AddListener(CharacterSlot2);


        spriteRenderer.sprite = standingSprites[playingChr];
        charSlot1.sprite      = iconSprites[firstSlotChr];
        charSlot2.sprite      = iconSprites[secondSlotChr];
    }
Exemple #9
0
 public static IQueryable <IGrouping <int, TSource> > GroupByCount <TSource>(this IQueryable <TSource> @this, int groupCount, PadDirection padDirection)
 {
     throw new NotSupportedException();
 }
Exemple #10
0
 public static ZeroPaddedSpan SliceWithZeroPadding(this byte[] bytes, int startIndex, int length, PadDirection padDirection = PadDirection.Right) =>
 bytes.AsSpan().SliceWithZeroPadding(startIndex, length, padDirection);
Exemple #11
0
        public static ZeroPaddedSpan SliceWithZeroPadding(this Span <byte> bytes, UInt256 startIndex, int length, PadDirection padDirection = PadDirection.Right)
        {
            if (startIndex >= bytes.Length || startIndex > int.MaxValue)
            {
                return(new ZeroPaddedSpan(Span <byte> .Empty, length, PadDirection.Right));
            }

            return(SliceWithZeroPadding(bytes, (int)startIndex, length, padDirection));
        }
Exemple #12
0
        private static ZeroPaddedSpan SliceWithZeroPadding(this Span <byte> bytes, int startIndex, int length, PadDirection padDirection)
        {
            if (startIndex >= bytes.Length)
            {
                return(new ZeroPaddedSpan(Span <byte> .Empty, length, padDirection));
            }

            if (length == 1)
            {
                // why do we return zero length here?
                // it was passing all the tests like this...
                // return bytes.Length == 0 ? new byte[0] : new[] {bytes[startIndex]};
                return(bytes.Length == 0 ? new ZeroPaddedSpan(Span <byte> .Empty, 0, padDirection) : new ZeroPaddedSpan(bytes.Slice(startIndex, 1), 0, padDirection));
                // return bytes.Length == 0 ? new ZeroPaddedSpan(Span<byte>.Empty, 1) : new ZeroPaddedSpan(bytes.Slice(startIndex, 1), 0);
            }

            int copiedLength = Math.Min(bytes.Length - startIndex, length);

            return(new ZeroPaddedSpan(bytes.Slice(startIndex, copiedLength), length - copiedLength, padDirection));
        }
        public void Can_slice_with_zero_padding(string inputHex, int startIndex, int length, PadDirection padDirection, string expectedResultHex)
        {
            byte[]         input  = Bytes.FromHexString(inputHex);
            ZeroPaddedSpan result = input.SliceWithZeroPadding(startIndex, length, padDirection);

            Assert.AreEqual(expectedResultHex, result.ToArray().ToHexString(true));
        }
 public Pad(PadDirection direction) : this(IntPtr.Zero, direction)
 {
 }
 unsafe private static extern IntPtr gst_pad_new(IntPtr name, PadDirection direction);
        public static string TrimCleanPad(this string value, StringContent preserveContent, PadDirection padDirection, char padChar, int padLength, bool removeDoubleSpaces = false, bool forceNullToString = true, bool forceFixedLength = true)
        {
            // trim and clean
            value = value.TrimClean(preserveContent, removeDoubleSpaces, forceNullToString);

            // if value is still a null then nothing to do.
            if (value == null)
            {
                return(value);
            }

            // pad
            switch (padDirection)
            {
            case PadDirection.Left:
                value = value.PadLeft(padLength, padChar);
                break;

            case PadDirection.Right:
                value = value.PadRight(padLength, padChar);
                break;
            }

            // force the length
            if (forceFixedLength && value.Length > padLength)
            {
                value = value.Substring(0, padLength);
            }

            return(value);
        }
 /// <summary>コンストラクタ</summary>
 /// <param name="padDir">パッド方向</param>
 /// <param name="padChar">パッド文字</param>
 public EditPadding(PadDirection padDir, char?padChar)
 {
     this.PadDir  = padDir;
     this.PadChar = padChar;
 }
 private static unsafe extern IntPtr gst_pad_new(IntPtr name, PadDirection direction);
 public Pad(PadDirection direction)
     : this(IntPtr.Zero, direction)
 {
 }
Exemple #20
0
 /// <summary>コンストラクタ</summary>
 /// <param name="padDir">パッド方向</param>
 /// <param name="padChar">パッド文字</param>
 public EditPadding(PadDirection padDir, char? padChar)
 {
     this.PadDir = padDir;
     this.PadChar = padChar;
 }
 protected Pad(IntPtr native_name, PadDirection direction)
     : this(gst_pad_new (native_name, direction))
 {
 }
Exemple #22
0
 public ZeroPaddedSpan(ReadOnlySpan <byte> span, int paddingLength, PadDirection padDirection)
 {
     PadDirection  = padDirection;
     Span          = span;
     PaddingLength = paddingLength;
 }
        /// <summary>
        /// Groups the elements of a sequence according to the count of group capacity.
        /// </summary>
        /// <typeparam name="TSource"></typeparam>
        /// <param name="this"></param>
        /// <param name="groupCount"></param>
        /// <returns></returns>
        public static IEnumerable <IGrouping <int, TSource> > GroupByCount <TSource>(this IEnumerable <TSource> @this, int groupCount, PadDirection padDirection)
        {
            switch (padDirection)
            {
            case PadDirection.Default:
            case PadDirection.Right:
                return(@this
                       .Select((v, i) => new { Key = i, Value = v })
                       .GroupBy(x => x.Key / groupCount, x => x.Value));

            case PadDirection.Left:
                var count = @this.Count();
                return(@this
                       .Select((v, i) => new { Key = i, Value = v })
                       .GroupBy(x => (x.Key + (groupCount - count % groupCount)) / groupCount, x => x.Value));

            default: throw new NotSupportedException();
            }
        }
 protected Pad(IntPtr native_name, PadDirection direction) : this(gst_pad_new(native_name, direction))
 {
 }