Exemple #1
0
        //Fills the extrude object with tail part extrudes
        public void generateArrowTail()
        {
            ArrowTip arrowTail = arrowPath.arrowTail;

            if (arrowTail.arrowTipMode == ArrowTip.ArrowTipMode.Extrude)
            {
                //Tail has to be reversed for the complete extrude
                for (int i = arrowTail.extrudePoints.Length - 1; i >= 0; i--)
                {
                    extrudeObject.extrudePath[extrudePathIndex]       = arrowTail.extrudePoints[i];
                    extrudeObject.polygonsToExtrude[extrudePathIndex] = arrowTail.primitives[i];
                    extrudeObject.openCloseExtrude[extrudePathIndex]  = arrowTail.openClosed[i];
                    //Start extrude and end extrude are also reveresed when putting into complete extrude
                    if (extrudeObject.openCloseExtrude[extrudePathIndex] == 0)
                    {
                        extrudeObject.openCloseExtrude[extrudePathIndex] = 2;
                    }
                    else
                    {
                        if (extrudeObject.openCloseExtrude[extrudePathIndex] == 2)
                        {
                            extrudeObject.openCloseExtrude[extrudePathIndex] = 0;
                        }
                    }
                    extrudePathIndex++;
                }
            }
        }
Exemple #2
0
 void Awake()
 {
     arrowIndicator = ScriptableObject.CreateInstance <ArrowIndicator>();
     if (arrowPath == null)
     {
         arrowIndicator.arrowPath = ScriptableObject.CreateInstance <ArrowPath>();
         arrowPath = arrowIndicator.arrowPath;
         arrowIndicator.arrowPath.arrowPathMode = ArrowPath.ArrowPathMode.None;
     }
     arrowIndicator.arrowPath = arrowPath;
     if (!permanentScriptableObjects)
     {
         arrowIndicator.arrowPath = Instantiate(arrowIndicator.arrowPath);
         arrowPath = arrowIndicator.arrowPath;
     }
     if (arrowHead == null)
     {
         arrowHead = ScriptableObject.CreateInstance <ArrowTip>();
         arrowHead.arrowTipMode = ArrowTip.ArrowTipMode.None;
     }
     if (arrowTail == null)
     {
         arrowTail = ScriptableObject.CreateInstance <ArrowTip>();
         arrowTail.arrowTipMode = ArrowTip.ArrowTipMode.None;
     }
     arrowIndicator.arrowPath.arrowHead = arrowHead;
     arrowIndicator.arrowPath.arrowTail = arrowTail;
     if (permanentScriptableObjects)
     {
         if (arrowIndicator.arrowPath.arrowHead == arrowIndicator.arrowPath.arrowTail)
         {
             arrowIndicator.arrowPath.arrowTail = Instantiate(arrowIndicator.arrowPath.arrowTail);
             arrowTail = arrowIndicator.arrowPath.arrowTail;
         }
     }
     else
     {
         arrowIndicator.arrowPath.arrowHead = Instantiate(arrowIndicator.arrowPath.arrowHead);
         arrowHead = arrowIndicator.arrowPath.arrowHead;
         arrowIndicator.arrowPath.arrowTail = Instantiate(arrowIndicator.arrowPath.arrowTail);
         arrowTail = arrowIndicator.arrowPath.arrowTail;
     }
     if (flatShading)
     {
         arrowIndicator.extrudeObject = ScriptableObject.CreateInstance <FlatShadeExtrude>();
     }
     else
     {
         arrowIndicator.extrudeObject = ScriptableObject.CreateInstance <ComplexExtrude>();
     }
 }
Exemple #3
0
        //Fills the extrude object with head part extrudes
        public void generateArrowHead()
        {
            ArrowTip arrowHead = arrowPath.arrowHead;

            if (arrowHead.arrowTipMode == ArrowTip.ArrowTipMode.Extrude)
            {
                for (int i = 0; i < arrowHead.extrudePoints.Length; i++)
                {
                    extrudeObject.extrudePath[extrudePathIndex]       = arrowHead.extrudePoints[i];
                    extrudeObject.polygonsToExtrude[extrudePathIndex] = arrowHead.primitives[i];
                    extrudeObject.openCloseExtrude[extrudePathIndex]  = arrowHead.openClosed[i];
                    extrudePathIndex++;
                }
            }
        }