public void SetConnection(PathMarker pathMarker, PathMarker pathOrigin, MarkerAlterAction alterAction, PathSkill skillToUse) { ConnectionPathMarker = pathMarker; ConnectionPathOrigin = pathOrigin; PathAlterAction = alterAction; SkillToUse = skillToUse; }
public void Finish() { if (mFinished) { return; } ConnectionPathMarker = null; ConnectionPathOrigin = null; PathAlterAction = MarkerAlterAction.None; SkillToUse = null; mFinished = true; GameObject.Destroy(gameObject); }
protected void CheckPathConnections(PathMarker nearbyPathMarker) { //TODO possibly remove this as Paths now handles this task //check the nearby path markers //if one of them is not a neigbor //then we know we're supposed to try and link it if (nearbyPathMarker == null || nearbyPathMarker.IsFinished) { return; } else if (!Paths.IsNeighbor(nearbyPathMarker, this)) { MarkerAlterAction alterAction = MarkerAlterAction.None; if (Paths.CanAttachPathMarker(nearbyPathMarker, this, out alterAction)) { //this calls for a skill Skill learnedSkill = null; PathSkill skillToUse = null; switch (alterAction) { case MarkerAlterAction.AppendToPath: case MarkerAlterAction.CreateBranch: if (Skills.Get.HasLearnedSkill("AlterPath", out learnedSkill)) { skillToUse = learnedSkill as PathSkill; } break; case MarkerAlterAction.CreatePath: case MarkerAlterAction.CreatePathAndBranch: if (Skills.Get.HasLearnedSkill("CreatePath", out learnedSkill)) { skillToUse = learnedSkill as PathSkill; } break; case MarkerAlterAction.None: default: break; } if (skillToUse != null) { Paths.CreateTemporaryConnection(nearbyPathMarker, this, alterAction, skillToUse); } } } }