// Start is called before the first frame update
    void Start()
    {
        soundManager = FindObjectOfType <SoundManager>();
        player       = FindObjectOfType <OVRManager>();
        colorChanger = FindObjectOfType <ChangeColors>();
        fader        = FindObjectOfType <FadeUIElement>();

        foreach (GameObject node in Node0)
        {
            node.GetComponent <BaseHitObject>().ListNum = 0;
        }

        foreach (GameObject node in Node1)
        {
            node.GetComponent <BaseHitObject>().ListNum = 1;
        }

        foreach (GameObject node in Node2)
        {
            node.GetComponent <BaseHitObject>().ListNum = 2;
        }

        foreach (GameObject node in Node3)
        {
            node.GetComponent <BaseHitObject>().ListNum = 3;
        }

        foreach (GameObject node in Node4)
        {
            node.GetComponent <BaseHitObject>().ListNum = 4;
        }
    }
Beispiel #2
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                _model.ReadString(reader);
                _animationGraph.ReadString(reader);
                _collisionModel.ReadString(reader);
                _physics.ReadString(reader);
                _modifierShader.ReadString(reader);
                _creationEffect.ReadString(reader);
                for (x = 0; (x < _attachments.Count); x = (x + 1))
                {
                    Attachments.Add(new ObjectAttachmentBlock());
                    Attachments[x].Read(reader);
                }
                for (x = 0; (x < _attachments.Count); x = (x + 1))
                {
                    Attachments[x].ReadChildData(reader);
                }
                for (x = 0; (x < _widgets.Count); x = (x + 1))
                {
                    Widgets.Add(new ObjectWidgetBlock());
                    Widgets[x].Read(reader);
                }
                for (x = 0; (x < _widgets.Count); x = (x + 1))
                {
                    Widgets[x].ReadChildData(reader);
                }
                for (x = 0; (x < _functions.Count); x = (x + 1))
                {
                    Functions.Add(new ObjectFunctionBlock());
                    Functions[x].Read(reader);
                }
                for (x = 0; (x < _functions.Count); x = (x + 1))
                {
                    Functions[x].ReadChildData(reader);
                }
                for (x = 0; (x < _changeColors.Count); x = (x + 1))
                {
                    ChangeColors.Add(new ObjectChangeColorsBlock());
                    ChangeColors[x].Read(reader);
                }
                for (x = 0; (x < _changeColors.Count); x = (x + 1))
                {
                    ChangeColors[x].ReadChildData(reader);
                }
                for (x = 0; (x < _predictedResources.Count); x = (x + 1))
                {
                    PredictedResources.Add(new PredictedResourceBlock());
                    PredictedResources[x].Read(reader);
                }
                for (x = 0; (x < _predictedResources.Count); x = (x + 1))
                {
                    PredictedResources[x].ReadChildData(reader);
                }
            }
 public void ReadChildData(BinaryReader reader)
 {
     _model.ReadString(reader);
     _animationGraph.ReadString(reader);
     _collisionModel.ReadString(reader);
     _physics.ReadString(reader);
     _modifierShader.ReadString(reader);
     _creationEffect.ReadString(reader);
     for (int x = 0; x < _attachments.Count; x++)
     {
         Attachments.AddNew();
         Attachments[x].Read(reader);
     }
     for (int x = 0; x < _attachments.Count; x++)
     {
         Attachments[x].ReadChildData(reader);
     }
     for (int x = 0; x < _widgets.Count; x++)
     {
         Widgets.AddNew();
         Widgets[x].Read(reader);
     }
     for (int x = 0; x < _widgets.Count; x++)
     {
         Widgets[x].ReadChildData(reader);
     }
     for (int x = 0; x < _functions.Count; x++)
     {
         Functions.AddNew();
         Functions[x].Read(reader);
     }
     for (int x = 0; x < _functions.Count; x++)
     {
         Functions[x].ReadChildData(reader);
     }
     for (int x = 0; x < _changeColors.Count; x++)
     {
         ChangeColors.AddNew();
         ChangeColors[x].Read(reader);
     }
     for (int x = 0; x < _changeColors.Count; x++)
     {
         ChangeColors[x].ReadChildData(reader);
     }
     for (int x = 0; x < _predictedResources.Count; x++)
     {
         PredictedResources.AddNew();
         PredictedResources[x].Read(reader);
     }
     for (int x = 0; x < _predictedResources.Count; x++)
     {
         PredictedResources[x].ReadChildData(reader);
     }
 }
 public void ReadChildData(BinaryReader reader)
 {
     _actorDefinition.ReadString(reader);
     _unit.ReadString(reader);
     _majorVariant.ReadString(reader);
     _weapon.ReadString(reader);
     _equipment.ReadString(reader);
     for (int x = 0; x < _changeColors.Count; x++)
     {
         ChangeColors.AddNew();
         ChangeColors[x].Read(reader);
     }
     for (int x = 0; x < _changeColors.Count; x++)
     {
         ChangeColors[x].ReadChildData(reader);
     }
 }
Beispiel #5
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                _actorDefinition.ReadString(reader);
                _unit.ReadString(reader);
                _majorVariant.ReadString(reader);
                _weapon.ReadString(reader);
                _equipment.ReadString(reader);
                for (x = 0; (x < _changeColors.Count); x = (x + 1))
                {
                    ChangeColors.Add(new ActorVariantChangeColorsBlock());
                    ChangeColors[x].Read(reader);
                }
                for (x = 0; (x < _changeColors.Count); x = (x + 1))
                {
                    ChangeColors[x].ReadChildData(reader);
                }
            }
Beispiel #6
0
    /*
     * Color Adder Stuff
     */
    private void ColorAdderOkay()
    {
        bool      exists = false;
        ColorTile ct;

        // cycle through output colors
        for (int i = 0; i != output_tiles.Count; i++)
        {
            // check if this exists in output colors
            if (adder_preview.color.Equals(output_tiles[i].color))
            {
                exists = true;
                break;
            }
        }

        // check if we have this color already
        if (!exists)
        {
            // create a new color tile
            GameObject newObj = Instantiate(prefab, output_viewport.transform) as GameObject;
            newObj.name = "output_color_" + output_tiles.Count.ToString();
            ct          = newObj.GetComponent(typeof(ColorTile)) as ColorTile;
            ct.Setup(false, adder_preview.color, adder_preview.color, ref newObj);

            // add to the output palette
            output_colors.Add(newObj);

            // add color tile to our list of tiles
            output_tiles.Add(ct);

            // add undo action
            ChangeColors.AddUndo("delete color", adder_preview.color, adder_preview.color);
        }

        // close color adder normally
        ColorAdderCancel();
    }
    private void ClickHandler()
    {
        if (is_input_palette)
        {
            // turn off output_ref
            if (output_ref != null)
            {
                output_ref.Highlight(false);
                output_ref = null;
            }

            // no input color
            if (input_ref == null)
            {
                ChangeColors.SetColorInputs(color, match);
                input_ref = this;
                Highlight();
                HighlightMatch(match);
            }
            // change input color
            else if (input_ref != this)
            {
                ChangeColors.SetColorInputs(color, match);
                input_ref.Highlight(false);
                input_ref = this;
                Highlight();
                HighlightMatch(match);
            }
            // de-select input color
            else if (input_ref == this)
            {
                ChangeColors.SetColorInputs();
                input_ref.Highlight(false);
                input_ref = null;
            }
        }
        else
        {
            // no colors selected
            if (output_ref == null)
            {
                // set color info so user can inspect output palette
                ChangeColors.SetColorInputs(color);
                output_ref = this;
                Highlight();
            }
            // change output color (with input)
            else if (output_ref != this && input_ref != null)
            {
                // add undo action
                ChangeColors.AddUndo("change match", input_ref.color, input_ref.match);

                // change the match color for the input
                ChangeColors.SetColorInputs(input_ref.color, this.color);
                output_ref.Highlight(false);
                Highlight();
                output_ref      = this;
                input_ref.match = this.color;

                // apply the change
                cc_ref.PickApply();
            }
            // change output color (no input)
            else if (output_ref != this && input_ref == null)
            {
                ChangeColors.SetColorInputs(color);
                output_ref.Highlight(false);
                output_ref = this;
                Highlight();
            }
            // de-select output color (no input)
            else if (input_ref == this && input_ref == null)
            {
                ChangeColors.SetColorInputs();
                input_ref.Highlight(false);
                output_ref.Highlight(false);
                input_ref  = null;
                output_ref = null;
            }
        }
    }