protected override void OnEditorUpdate() { base.OnEditorUpdate(); if (emitterShape == null) { emitterShape = GetComponent <SkillShape>(); } name = displayName; UpdateParticles(); }
private static Example.SkillShapeNew ExportSkillShape(SkillShape shape) { if (shape == null) { return(null); } Example.SkillShapeNew skillShape = new Example.SkillShapeNew(); skillShape.shapeType = shape.shapeType; skillShape.Width = shape.Width; skillShape.Height = shape.Height; skillShape.Radius = shape.Radius; skillShape.Angle = shape.Angle; return(skillShape); }
public void AddShape(SkillParticleActionItem sg, SkillShape shape) { GameObject targetObj = sg.gameObject; if (shape.shapeType == Example.SkillShapeNew.ShapeType.CIRCLE) { CircleSkillShape cskill = (CircleSkillShape)shape; CircleSkillShape shape0 = targetObj.AddComponent <CircleSkillShape>(); shape0.Target = targetObj.transform; shape0.offset = cskill.offset; shape0.radius = cskill.radius; sg.hitShape = shape0; } if (shape.shapeType == Example.SkillShapeNew.ShapeType.BOX) { BoxSkillShape cskill = (BoxSkillShape)shape; BoxSkillShape shape0 = targetObj.AddComponent <BoxSkillShape>(); shape0.Target = targetObj.transform; shape0.offset = cskill.offset; shape0.width = cskill.width; shape0.height = cskill.height; sg.hitShape = shape0; } if (shape.shapeType == Example.SkillShapeNew.ShapeType.SECTOR) { SectorSkillShape cskill = (SectorSkillShape)shape; SectorSkillShape shape0 = targetObj.AddComponent <SectorSkillShape>(); shape0.Target = targetObj.transform; shape0.offset = cskill.offset; shape0.angle = cskill.angle; shape0.radius = cskill.radius; sg.hitShape = shape0; } if (shape.shapeType == Example.SkillShapeNew.ShapeType.TRIANGLE) { TriangleSkillShape cskill = (TriangleSkillShape)shape; TriangleSkillShape shape0 = targetObj.AddComponent <TriangleSkillShape>(); shape0.Target = targetObj.transform; shape0.offset = cskill.offset; shape0.width = cskill.width; shape0.height = cskill.height; sg.hitShape = shape0; } }
static SkillShape CreateSkillShape(GameObject go, Example.SkillShapeNew.ShapeType type) { SkillShape shape = null; switch (type) { case Example.SkillShapeNew.ShapeType.BOX: shape = go.AddComponent <BoxSkillShape> (); break; case Example.SkillShapeNew.ShapeType.CIRCLE: var circle = go.AddComponent <CircleSkillShape> (); shape = circle; break; } shape.shapeType = type; return(shape); }
public override bool Intersect(SkillShape other) { return(base.Intersect(other)); }
SkillShape ReplaceShape(Example.SkillShapeNew.ShapeType oldShape, Example.SkillShapeNew.ShapeType newShape, GameObject targetObj, SkillShape shape, Transform actor, Vector3 offset) { if (oldShape != newShape) { if (shape != null) { DestroyImmediate(shape); } if (newShape == Example.SkillShapeNew.ShapeType.CIRCLE) { CircleSkillShape shape0 = targetObj.AddComponent <CircleSkillShape>(); shape0.Target = actor; shape0.offset = offset; return(shape0); } if (newShape == Example.SkillShapeNew.ShapeType.BOX) { BoxSkillShape shape0 = targetObj.AddComponent <BoxSkillShape>(); shape0.Target = actor; shape0.offset = offset; return(shape0); } if (newShape == Example.SkillShapeNew.ShapeType.SECTOR) { SectorSkillShape shape0 = targetObj.AddComponent <SectorSkillShape>(); shape0.Target = actor; shape0.offset = offset; return(shape0); } if (newShape == Example.SkillShapeNew.ShapeType.TRIANGLE) { TriangleSkillShape shape0 = targetObj.AddComponent <TriangleSkillShape>(); shape0.Target = actor; shape0.offset = offset; return(shape0); } if (newShape == Example.SkillShapeNew.ShapeType.NONE) { return(null); } } return(shape); }
public virtual bool Intersect(SkillShape other) { throw new Exception(GetType().Name + ".Intersect(SkillShape) not impl"); }