void Start() { if(curSegment.GetComponent<Tree_Segment_Script>() != null && curSegment.GetComponent<Tree_Segment_Script>().treeSegmentTypes != Tree_Segment_Script.TreeSegmentType.TREE) { treeStages = TreeStage.SPURT; } }
void Start() { if (curSegment.GetComponent <Tree_Segment_Script>() != null && curSegment.GetComponent <Tree_Segment_Script>().treeSegmentTypes != Tree_Segment_Script.TreeSegmentType.TREE) { treeStages = TreeStage.SPURT; } }
public TownTree(int type) { _Stage = TreeStage.One; TreeType = type; int[,] list; Point3D treeOffset; switch (type) { default: list = m_Type1; treeOffset = new Point3D(1, 0, 0); break; case 2: list = m_Type2; treeOffset = new Point3D(1, 1, 0); break; case 3: list = m_Type3; treeOffset = new Point3D(0, 0, 0); break; case 4: list = m_Type4; treeOffset = new Point3D(-1, 0, 0); break; } AddComponent(new TownTreeComponent(), treeOffset.X, treeOffset.Y, treeOffset.Z); for (int i = 0; i < list.Length / 4; i++) { var id = list[i, 0]; if (id == 6077) { id = Utility.RandomList(6077, 6078, 6079, 6080); } AddComponent(new AddonComponent(id), list[i, 1], list[i, 2], list[i, 3]); } }
public Sprite GetSprite(TreeStage stage) { switch (stage) { case TreeStage.Stage0: return(stage0); case TreeStage.Stage1: return(stage1); case TreeStage.Stage2: return(stage2); case TreeStage.Stage3: return(stage3); case TreeStage.product: return(product); } Debug.LogError("Could not return tree sprite"); return(null); }