public override void Reset()
 {
     axisName           = new ConcreteStringVar();
     storeAxisComponent = Vector3Component.x;
     storeAxis          = new ConcreteVector3Var();
     multiplier         = 1f;
 }
        public override void Reset () {
            base.Reset();

            a = new ConcreteVector3Var();
            aComponent = Vector3Component.x;
            b = new ConcreteFloatVar();
        }
Exemple #3
0
        public Entity AddVector3(UnityEngine.Vector3 newVector3)
        {
            var component = new Vector3Component();

            component.vector3 = newVector3;
            return(AddVector3(component));
        }
Exemple #4
0
        public override void Reset()
        {
            base.Reset();

            a          = new ConcreteVector3Var();
            aComponent = Vector3Component.x;
            b          = new ConcreteFloatVar();
        }
        protected override void InitializeComponents(string aText)
        {
            myCooldown = new NumericTextComponent(new Point(myLocation.X, myLocation.Y), mySize, "Cooldown");

            mySpread = new NumericTextComponent(new Point(myLocation.X, myLocation.Y + mySize.Height + 10), mySize, "Spread");

            myBulletsPerShot = new NumericTextComponent(new Point(myLocation.X, myLocation.Y + ((mySize.Height * 2) + 20)), mySize, "Bullet/Shot");

            myPosition = new Vector3Component(new Point(myLocation.X, myLocation.Y + ((mySize.Height * 3) + 30)),
                                              new Size(mySize.Width, 13), "Position");
        }
 public Entity ReplaceVector3(UnityEngine.Vector3 newVector3)
 {
     Vector3Component component;
     if (hasVector3) {
         WillRemoveComponent(ComponentIds.Vector3);
         component = vector3;
     } else {
         component = new Vector3Component();
     }
     component.vector3 = newVector3;
     return ReplaceComponent(ComponentIds.Vector3, component);
 }
        protected override void IntitalizeControls()
        {
            mySpeed = new MinMaxComponent(new Point(Location.X, Location.Y + 10), new Size(Size.Width, 13), "Speed");
            mySpeed.AddTextChangeEvent(this.PanelDataChanged);
            mySpeed.BindToPanel(this);
            mySpeed.Show();

            myTimeToNextDecision = new MinMaxComponent(new Point(Location.X, Location.Y + 30), new Size(Size.Width, 13), "TimeToNextDecision");
            myTimeToNextDecision.AddTextChangeEvent(this.PanelDataChanged);
            myTimeToNextDecision.BindToPanel(this);
            myTimeToNextDecision.Show();

            myFollowEntity = new NumericTextComponent(new Point(Location.X, Location.Y + 50), new Size(275, 13), "Follow Entity", false);
            myFollowEntity.AddTextChangeEvent(this.PanelDataChanged);
            myFollowEntity.BindToPanel(this);
            myFollowEntity.Show();

            myAIMode = new DropDownComponent(new Point(Location.X, Location.Y + 70), new Size(150, 13), "AIMode");
            myAIMode.AddSelectedIndexChangeEvent(this.PanelDataChanged);
            myAIMode.BindToPanel(this);
            myAIMode.Show();

            myAiTurnRate = new NumericTextComponent(new Point(Location.X, Location.Y + 100), new Size(275, 13), "AITurnRate");
            myAiTurnRate.AddTextChangeEvent(this.PanelDataChanged);
            myAiTurnRate.BindToPanel(this);
            myAiTurnRate.Show();

            myAvoidanceLabel.Text     = "Avoidance";
            myAvoidanceLabel.Location = new Point(Location.X, Location.Y + 120);
            myAvoidanceLabel.Size     = new Size(100, 13);
            myAvoidanceLabel.Show();
            this.Controls.Add(myAvoidanceLabel);

            myAvoidanceDistance = new NumericTextComponent(new Point(Location.X, Location.Y + 140), new Size(150, 13), "Distance");
            myAvoidanceDistance.AddTextChangeEvent(this.PanelDataChanged);
            myAvoidanceDistance.BindToPanel(this);
            myAvoidanceDistance.Show();


            myAvoidanceOffset = new Vector3Component(new Point(Location.X, Location.Y + 160), new Size(275, 13), "Offset");
            myAvoidanceOffset.AddTextChangeEvent(this.PanelDataChanged);
            myAvoidanceOffset.BindToPanel(this);
            myAvoidanceOffset.Show();

            myAIMode.AddItem("Keep Distance");
            myAIMode.AddItem("Escape then return");
            myAIMode.AddItem("Kamikaze");
        }
        /// <summary>
        /// Strips one of the components from the vector
        /// </summary>
        /// <param name="vec"></param>
        /// <param name="component"></param>
        /// <returns></returns>
        public static Vector3 StripComponent(this Vector3 vec, Vector3Component component)
        {
            switch (component)
            {
            case Vector3Component.x:
                return(new Vector3(0f, vec.y, vec.z));

            case Vector3Component.y:
                return(new Vector3(vec.x, 0f, vec.z));

            case Vector3Component.z:
                return(new Vector3(vec.x, vec.y, 0f));
            }

            throw new System.Exception("Missing component");
        }
Exemple #9
0
        public Entity ReplaceVector3(UnityEngine.Vector3 newVector3)
        {
            Vector3Component component;

            if (hasVector3)
            {
                WillRemoveComponent(ComponentIds.Vector3);
                component = vector3;
            }
            else
            {
                component = new Vector3Component();
            }
            component.vector3 = newVector3;
            return(ReplaceComponent(ComponentIds.Vector3, component));
        }
Exemple #10
0
        protected override void IntitalizeControls()
        {
            myPropertyTitle.Text += "Graphcis Component";;

            myModelPanel = new GCP_ModelPanel(new Point(this.Location.X, this.Location.Y));

            myModelPanel.BindToPanel(this);

            myModelPanel.GetModelPath().GetButton().Click  += new System.EventHandler(this.ModelBrosweClick);
            myModelPanel.GetEffectPath().GetButton().Click += new System.EventHandler(this.EffectBrosweClick);

            myModelPanel.Show();

            myScale = new Vector3Component(new Point(Location.X, Location.Y + 60), new Size(275, 40), "Scale");
            myScale.AddTextChangeEvent(this.PanelDataChanged);
            myScale.BindToPanel(this);
            myScale.Show();
        }
        private void BuildComponent(string aType, ComponentIO aIO)
        {
            BaseComponent newComponent = null;

            switch (aType)
            {
            case "DLLPreview":
                newComponent = new DLLPreviewComponent(new Point(0, 0), new Size(700, 530), "DLLPreview", myCurrentPanelName);
                break;

            case "Vector3":
                newComponent = new Vector3Component(new Point(0, 0), new Size(120, 13), aIO.myIOElementName, myCurrentPanelName);
                break;
            }
            if (newComponent != null)
            {
                myComponents.Add(newComponent);
            }
        }
        public static Vector3 ChangeComponent( this Vector3 vec3, Vector3Component com, float value )
        {
            switch ( com )
            {
            case Vector3Component.X:
                vec3.X = value;
                break;

            case Vector3Component.Y:
                vec3.Y = value;
                break;

            case Vector3Component.Z:
                vec3.Z = value;
                break;

            default:
                throw new EnumException<Vector3Component>( nameof( com ), com );
            }

            return vec3;
        }
        public static float GetComponent( this Vector3 vec3, Vector3Component com )
        {
            switch ( com )
            {
            case Vector3Component.X:
                return vec3.X;

            case Vector3Component.Y:
                return vec3.Y;

            case Vector3Component.Z:
                return vec3.Z;

            default:
                throw new EnumException<Vector3Component>( nameof( com ), com );
            }
        }
 public Entity AddVector3(Vector3Component component)
 {
     return AddComponent(ComponentIds.Vector3, component);
 }
Exemple #15
0
 public override void Reset () {
     axisName = new ConcreteStringVar();
     storeAxisComponent = Vector3Component.x;
     storeAxis = new ConcreteVector3Var();
     multiplier = 1f;
 }
Exemple #16
0
 public Entity AddVector3(Vector3Component component)
 {
     return(AddComponent(ComponentIds.Vector3, component));
 }
 public Entity AddVector3(UnityEngine.Vector3 newVector3)
 {
     var component = new Vector3Component();
     component.vector3 = newVector3;
     return AddVector3(component);
 }