private static void Main(string[] args) { using (var model = new postgresEntities()) { var hans = Plant.CreatePlant(0, "hans"); hans.PositionSwitch = PositionSwitch.CreatePositionSwitch(0, 1, 12); model.PositionSwitches.AddObject(hans.PositionSwitch); model.Plants.AddObject(hans); model.SaveChanges(); } }
[SerializeField] private Transform _pos2; //the second position void Start() { _switch = GetComponent <PositionSwitch>(); //gets the position switch _switch.SetPositionOne(this.transform.localPosition); //sets the first position _switch.SetPositionTwo(_pos2.localPosition); //sets the second position }
void Start() { //_input = GameObject.Find("GameController").GetComponent<InputHandler> (); _posSwitch = GetComponentInParent <PositionSwitch> ();; }