상속: MonoBehaviour
예제 #1
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            _flags         = loader.ReadUInt32();
            PolygonControl = new PolygonControl()
            {
                Value = loader.ReadUInt32()
            };
            DepthControl = new DepthControl()
            {
                Value = loader.ReadUInt32()
            };
            AlphaControl = new AlphaControl()
            {
                Value = loader.ReadUInt32()
            };
            AlphaRefValue = loader.ReadSingle();
            ColorControl  = new ColorControl()
            {
                Value = loader.ReadUInt32()
            };
            BlendTarget  = loader.ReadUInt32();
            BlendControl = new BlendControl()
            {
                Value = loader.ReadUInt32()
            };
            BlendColor = loader.ReadVector4F();
        }
예제 #2
0
    void Start()
    {
        sc = GetComponent <SizeControl>();
        cc = GetComponent <ColorControl>();

        cc.SetColor(ColorAtStart);
        SetSizeGrowth();
    }
예제 #3
0
        private void ProjectChanged(ColorControl sender, AvaloniaPropertyChangedEventArgs args)
        {
            var header = this.Find <Grid>("HeaderGrid");

            header.ColumnDefinitions.Clear();

            UpdateLayout();
        }
예제 #4
0
 public void GetColorStatus(out byte showMode, out ColorControl currentColor)
 {
     showMode     = 0;
     currentColor = ColorControl.BlackWhiteColor;
     RunCommand(Command.COLOR_STATUS, new byte[] { 0x1 }, 8);
     showMode     = _response[6];
     currentColor = (ColorControl)_response[7];
 }
 /// <summary>
 /// Sets the parent and color control of the gameobject
 /// </summary>
 private void Awake()
 {
     //get parent
     parent         = GameObject.Find(gameObject.transform.parent.gameObject.name);
     parentPosition = parent.GetComponent <Position>();
     //get renderer
     colorControl = GetComponent <ColorControl>();
 }
예제 #6
0
    public override void OnInspectorGUI()
    {
        styleHeader.fontSize         = 17;
        styleHeader.alignment        = TextAnchor.MiddleCenter;
        styleHeader.fontStyle        = FontStyle.Bold;
        styleHeader.normal.textColor = Color.white;
        styleLine.fontSize           = 15;
        styleLine.alignment          = TextAnchor.MiddleCenter;
        styleSmall.fontSize          = 10;
        styleSmall.alignment         = TextAnchor.MiddleLeft;
        styleSmall2.fontSize         = 8;
        styleSmall2.alignment        = TextAnchor.MiddleLeft;
        ColorControl t = (ColorControl)target;

        //
        GUILayout.BeginHorizontal();
        GUILayout.Label("Options", styleHeader);
        GUILayout.EndHorizontal();
        //
        GUILayout.BeginHorizontal();
        GUILayout.Label("---------------------------------------------------", styleLine);
        GUILayout.EndHorizontal();
        //

        //
        GUILayout.BeginHorizontal(EditorStyles.helpBox);
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Reset Color", GUILayout.Width(90f), GUILayout.Height(35f)))
        {
            t.ResetColor();
            EditorUtility.SetDirty(t);
        }
        if (GUILayout.Button("Enable Glow", GUILayout.Width(90f), GUILayout.Height(35f)))
        {
            t.glowActive = true;
            EditorUtility.SetDirty(t);
        }
        if (GUILayout.Button("Disable Glow", GUILayout.Width(90f), GUILayout.Height(35f)))
        {
            t.glowActive = false;
            EditorUtility.SetDirty(t);
        }

        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        //

        //
        GUILayout.BeginVertical(EditorStyles.helpBox);
        DrawDefaultInspector();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Light color always gets the second color tick in the gradient.", styleSmall);
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        //
    }
예제 #7
0
        private void ColorControl_TextChanged(object sender, EventArgs e)
        {
            ColorControl colorControl = sender as ColorControl;
            Color        c;

            if (NetSettings.View.DataViewHelper.TryGetColor(colorControl.Text, out c))
            {
                SetValue((sender as Control).Tag as VisualItem, c, ItemChangedMode.OnTheFly);
            }
        }
예제 #8
0
 void Awake()
 {
     //psuedo-singleton design
     if (color == null)
     {
         DontDestroyOnLoad(gameObject);
         color = this;
     }
     else if (color != this)
     {
         Destroy(gameObject);
     }
 }
예제 #9
0
 // Use this for initialization
 void Awake()
 {
     if (estadoJuego == null)
     {
         estadoJuego = this;
         DontDestroyOnLoad(gameObject);
         colorControl = GetComponent <ColorControl>();
     }
     else
     {
         estadoJuego.ImageHudItemActual = ImageHudItemActual;
         Destroy(gameObject);
     }
 }
예제 #10
0
        private bool IsCheck(Color color)
        {
            Piece           king             = King(color);
            List <Position> attackedPosition = AllAttackedPositions(ColorControl.OppositeColor(color));

            if (attackedPosition.Contains(king.position))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #11
0
        void MenuSettings_Click(object sender, EventArgs e)
        {
            Control      p = sender as Control;
            ColorDialog  dialog;
            VisualItem   item         = GetItemFromControl(p);
            ColorControl colorControl = item.controlsGroup.control as ColorControl;

            if ((dialog = new ColorDialog()
            {
                FullOpen = true, Color = (Color)GetValue(item.Item.FullName)
            }).ShowDialog() == DialogResult.OK)
            {
                SetValue(item, dialog.Color);
            }
        }
예제 #12
0
    void Start()
    {
        sc = GetComponent <SizeControl>();
        cc = GetComponent <ColorControl>();


        // initiate color
        int NumberOfBasicColors = BasicColors.Length;

        cc.SetColor(BasicColors[Random.Range(0, NumberOfBasicColors)]);

        SetSizeGrowth();

        // initiate rotation and movement
        Rotate(Random.Range(0, 360)); // [deg]
        turnrate = (Random.Range(0, 2) * 2 - 1) * Random.Range(minturnrate, maxturnrate) * Time.deltaTime;
        moverate = moverate * Time.deltaTime;
    }
예제 #13
0
        public void AddKing(Color color)
        {
            while (true)
            {
                Console.Write($"Podaj pozycje krola o kolorze {color}: ");
                string consoleNotationPosition = Console.ReadLine();
                if (consoleNotationPosition.Length == 2)
                {
                    int?            x = ToProgramNotation.FromX(consoleNotationPosition[0]);
                    int?            y = ToProgramNotation.FromY(consoleNotationPosition[1]);
                    List <Position> attackedPositions = AllAttackedPositions(ColorControl.OppositeColor(color));

                    if (x != null && y != null)
                    {
                        Position position = new Position(x.Value, y.Value);
                        if (ReturnPieceByPosition(position) == null && !attackedPositions.Contains(position))
                        {
                            pieces.Add(new King(new Position(x.Value, y.Value), color));
                            break;
                        }
                    }
                }
            }
        }
예제 #14
0
        private void SetControl(ParamDTO param, int position)
        {
            dynamic control = new Control();

            switch (param.Type)
            {
            case "System.Byte":
                control = new ByteControl();
                control.NameProperty = param.Name;
                break;

            case "System.Single":
                control = new FloatControl();
                control.NameProperty = param.Name;
                break;

            case "System.Drawing.Color":
                control = new ColorControl();
                control.NameProperty = param.Name;
                break;
            }

            this.tableLayoutPanel3.Controls.Add(control, 0, position - 1);
        }
예제 #15
0
	void Awake()
	{
		cc = GetComponent<ColorControl>();
		lobbyPlayer = GetComponent<NetworkLobbyPlayer>();
		Debug.Log ("PlayerLobby Awake");
	}
예제 #16
0
 public void SetColorStatus(ColorControl colorControl)
 {
     vc0706.SetColorControl((byte)colorControl);
 }
예제 #17
0
 void Awake()
 {
     cc          = GetComponent <ColorControl>();
     lobbyPlayer = GetComponent <NetworkLobbyPlayer>();
 }
예제 #18
0
        private void autoUst()
        {
            Utility.UnsafeBitmap uBitmap = new Utility.UnsafeBitmap((Bitmap)pictureBox1.BackgroundImage);
            uBitmap.LockBitmap();

            byte r, g, b;

            Point p1 = new Point(-1, -1);
            Point p2 = new Point(-1, -1);
            Point p3 = new Point(-1, -1);
            Point p4 = new Point(-1, -1);
            for (int y = 0; y < uBitmap.Bitmap.Size.Height; y+=2)
            {
                for (int x = 0; x < uBitmap.Bitmap.Size.Width; x+=2)
                {
                    r = uBitmap.GetPixel(x, y).red;
                    g = uBitmap.GetPixel(x, y).green;
                    b = uBitmap.GetPixel(x, y).blue;

                    if ((r - g > 100) && (r - b > 100))
                    {
                        ColorControl f = new ColorControl();
                        if (p1.X == -1)
                        {
                            p1 = f.PPoint(x, y, uBitmap.Bitmap);
                            x +=20;
                            y += 20;
                            continue;
                        }
                        if ((p1.X != -1) && (p2.X == -1))
                        {
                            p2 = f.PPoint(x,y,uBitmap.Bitmap);
                            x += 20;
                            y += 20;
                            continue;
                        }
                        if ((p2.X != -1) && (p3.X == -1))
                        {
                            p3 = f.PPoint(x, y, uBitmap.Bitmap);
                            x += 20;
                            y += 20;
                            continue;
                        }
                        if ((p3.X != -1) && (p4.X == -1))
                        {
                            p4 = f.PPoint(x, y, uBitmap.Bitmap);
                            x += 20;
                            y += 20;
                            continue;
                        }
                    }
                }

            }
        }
예제 #19
0
 void Awake()
 {
     cc = GetComponent<ColorControl>();
     lobbyPlayer = GetComponent<NetworkLobbyPlayer>();
 }
예제 #20
0
        public void AddRook(Color color)
        {
            while (true)
            {
                Console.Write($"Podaj pozycje wiezy o kolorze {color}: ");
                string consoleNotationPosition = Console.ReadLine();

                if (consoleNotationPosition.Length == 2)
                {
                    int?  x = ToProgramNotation.FromX(consoleNotationPosition[0]);
                    int?  y = ToProgramNotation.FromY(consoleNotationPosition[1]);
                    Piece rook;
                    if (x != null && y != null)
                    {
                        rook = new Rook(new Position(x.Value, y.Value), color);
                        Board hipoteticalBoard = this.DeepCopy();
                        hipoteticalBoard.pieces.Add(rook);
                        if (ReturnPieceByPosition(rook.position) == null && !hipoteticalBoard.IsCheck(ColorControl.OppositeColor(color)))
                        {
                            pieces.Add(rook);
                            break;
                        }
                    }
                }
            }
        }
예제 #21
0
 // Use this for initialization
 void Start()
 {
     colorControl    = GetComponent <ColorControl>();
     pocisionInicial = transform.position;
 }
예제 #22
0
 void Awake()
 {
     ResetColor();
     S = this;
 }
예제 #23
0
 public void SetColorControl(ColorControl color)
 {
     RunCommand(Command.COLOR_CTRL, new byte[] { 0x1, (byte)color }, 5);
 }
예제 #24
0
        private void ColorControl_KeyDown(object sender, KeyEventArgs e)
        {
            ColorControl colorControl = sender as ColorControl;

            RefreshControlValue((colorControl.Tag as VisualItem));
        }
예제 #25
0
/*
    public Object3D() : base()
    {
//	        Name = "Object3D";
    }
*/
    public override void Start()
    {
        base.Start();

        if (ColorControl == null)
            ColorControl = new ColorControl();
    }
예제 #26
0
 public void GetColorStatus(out byte showMode, out ColorControl currentColor)
 {
     showMode = 0;
     currentColor = ColorControl.BlackWhiteColor;
     RunCommand(Command.COLOR_STATUS, new byte[] { 0x1 }, 8);
     showMode = _response[6];
     currentColor = (ColorControl)_response[7];
 }
예제 #27
0
    /// <summary>
    /// This method is used to initialize all the objects used in the script.
    /// </summary>
    private void Awake()
    {
        // Get the snow globe object
        m_snowBall = GameObject.Find("SnowGlobe");

        // Get the water container object(water bucket)
        m_waterContainer = GameObject.Find("WaterContainer");

        // Get the water drop collector object.
        m_waterCollector = GameObject.Find("WaterCollector");

        // Get the pipe object
        m_vapourPipe = GameObject.Find("VapourSourceForPipe");

        // Gett the ice material
        m_iceMaterial = (Material)Resources.Load("IceMaterial");

        // Get the heater object - TODO chaging the color of heater
        m_heater = GameObject.Find("Heater");

        if (m_snowBall == null || m_waterContainer == null ||
            m_iceMaterial == null || m_vapourPipe == null ||
            m_waterCollector == null || m_heater == null)
        {
            Debug.LogError("ERROR - Some of the game objects are missing");
            return;
        }

        // Check that water is present inside the bucket
        if(m_waterContainer.transform.Find("ReflectiveWater") == null)
        {
            Debug.LogError("ERROR - No Reflective water found");
            return;
        }

        // check for vapour emitter at the end where water drops are collected
        if(m_vapourPipe.transform.Find("VapourEmitter") == null)
        {
            Debug.LogError("ERROR - No vapour emitter found");
            return;
        }

        // Access the vapour emitter object as it has been checked in the above step
        m_vapourEmitter = m_vapourPipe.transform.Find("VapourEmitter").gameObject;

        // Access the water drop script
        m_waterDropScript = (InstantiateWaterDrop)m_vapourPipe.GetComponent(typeof(InstantiateWaterDrop));

        // Get the reflective water script
        m_refWater = m_waterContainer.transform.Find("ReflectiveWater").gameObject;

        // get the water material. This is used to change water to ice and vice versa
        m_waterMaterial = m_refWater.renderer.material;

        // Check if water script is attached. If found get a pointer to it
        if (m_refWater.GetComponent(typeof(WaterSimple)) != null)
            m_waterScript = (WaterSimple)m_refWater.GetComponent(typeof(WaterSimple));
        else
            Debug.LogError("ERROR - No water script found");

        // Get a pointer to pully movement script
        if (m_waterCollector.GetComponent(typeof(PullyMovement)) != null)
            m_pullyScript = (PullyMovement)m_waterCollector.GetComponent(typeof(PullyMovement));
        else
            Debug.LogError("ERROR - No Pully script found");

        if (m_heater.GetComponent(typeof(ColorControl)) != null)
        {
            m_colorChangeScript = (ColorControl)m_heater.GetComponent(typeof(ColorControl));
            m_colorChangeScript.SetColorParams(ColorControl.PrimaryColor.r, 1.5f, 0.001f, false);
        }
        else
            Debug.LogError("ERROR - No ColorControl script found");
    }
예제 #28
0
 public void SetColorControl(ColorControl color)
 {
     RunCommand(Command.COLOR_CTRL, new byte[] { 0x1, (byte)color }, 5);
 }
예제 #29
0
    private void Awake()
    {
        // Get the water container object(water bucket)
        mWaterContainer = GameObject.Find("WaterContainer");

        // Get the reflective water script
        mRefWater = mWaterContainer.transform.Find("ReflectiveWater").gameObject;

        // get the water material. This is used to change water to ice and vice versa
        mWaterMaterial = mRefWater.renderer.material;

        // Gett the ice material
        mIceMaterial = (Material)Resources.Load("IceMaterial");

        // Get the pipe object
        mVapourPipe = GameObject.Find("VapourSourceForPipe");

        mWaterScript = (WaterSimple)mRefWater.GetComponent(typeof(WaterSimple));

        // Access the vapour emitter object as it has been checked in the above step
        mVapourEmitter = mVapourPipe.transform.Find("VapourEmitter").gameObject;

        // Access the water drop script
        mWaterDropScript = (InstantiateWaterDrop)mVapourPipe.GetComponent(typeof(InstantiateWaterDrop));

        mColorChangeScript = GameObject.Find("Heater").GetComponent<ColorControl>();

        mColorChangeScript.SetColorParams(ColorControl.PrimaryColor.r, 1.5f, 0.001f, false);

        mPullyScript = GameObject.Find("WaterCollector").GetComponent<PullyMovement>();

        particleEmitter = gameObject.transform.parent.gameObject.particleEmitter;
        audio = gameObject.transform.parent.gameObject.audio;
    }