public static GamePipeShadowView CreateShadow(GameObject shadowPrefab, GamePipe pipeDef, GameObject parent) { Vector3 position = pipeDef.StartPoint; GameObject newPipeObject = Instantiate(shadowPrefab, position, Quaternion.identity); newPipeObject.transform.SetParent(parent.transform); GamePipeShadowView component = newPipeObject.AddComponent <GamePipeShadowView>(); component.InitView(pipeDef); return(component); }
void CreatePipeShadow(GamePipe pipe) { GamePipeShadowView.CreateShadow(pipeShadowPrefab, pipe, pipeShadowParent); }