Example #1
0
    private bool doesSegmentCycleCondition(SnapPoints sp)
    {
        Vector3 currSegStartPos = sp.EndSnapPoint.position;
        Vector3 transfPos       = PositionCheckTransform.InverseTransformPoint(currSegStartPos);

        switch (PositionCheckAxis)
        {
        case Axis.None:
            return(transfPos == Vector3.zero);

            break;

        case Axis.X:
            return(transfPos.x > 0 == CheckIfGreater);

            break;

        case Axis.Y:
            return(transfPos.y > 0 == CheckIfGreater);

            break;

        case Axis.Z:
            return(transfPos.z > 0 == CheckIfGreater);

            break;

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
Example #2
0
    /// <summary>
    /// On awake, get all snap points and their relevant gameobject.
    /// </summary>
    private void Awake()
    {
        m_snapPoints = this.GetComponent <SnapPoints>();
        m_points     = m_snapPoints.m_Snappoints.ToArray();

        ///Initialise dictionary with every value within the array to a value of 0
        foreach (Class_Type bp in Enum.GetValues(typeof(Class_Type)))
        {
            m_dict.Add(bp.ToString(), 0);
        }
    }