public void Init(PawnStructConfig Config) { if (_moveComp) { _moveComp.Init(Config.MoveConfig); } if (_bodyComp) { _bodyComp.Init(Config.BodyConfig); } if (_shootComp) { _shootComp.Init(Config.ShootConfig); } }
BodyComponent NewBodyComponent(Vector3 location, bool isCore = false) { GameObject body; if (isCore) { body = (GameObject)Instantiate(corePrefab); } else { body = (GameObject)Instantiate(bodyPrefab); } body.transform.parent = this.transform; body.transform.localPosition = new Vector3(10000, 10000, 10000); BodyComponent bc = body.GetComponent <BodyComponent> (); bc.Init(this, location); bodyComponents.Add(location, bc); return(bc); }