//used for initialization
    void Start()
    {
        isCoolShot  = true;                                  //by default true
        audioSource = GetComponentsInParent <AudioSource>(); //get audio sources

        if (plane1 == null)
        {
            plane1 = GameObject.Find("Plane1").GetComponent <EntryPlane>();
        }
        if (plane2 == null)
        {
            plane2 = GameObject.Find("Plane2").GetComponent <EntryPlane>();
        }
        if (plane3 == null)
        {
            plane3 = GameObject.Find("Plane3").GetComponent <EntryPlane>();
        }
        if (plane4 == null)
        {
            plane4 = GameObject.Find("Plane4").GetComponent <EntryPlane>();
        }
        if (plane5 == null)
        {
            plane5 = GameObject.Find("Plane5").GetComponent <EntryPlane>();
        }
        if (plane6 == null)
        {
            plane6 = GameObject.Find("Plane6").GetComponent <EntryPlane>();
        }
    }
示例#2
0
    private NeighbourSide GetNeighbourSide(EntryPlane entryPlane)
    {
        switch (entryPlane)
        {
        case EntryPlane.XY:
            if ((_dimensionFlipFlags & 4) == 0)
            {
                return(NeighbourSide.Back);
            }
            return(NeighbourSide.Forward);

        case EntryPlane.XZ:
            if ((_dimensionFlipFlags & 2) == 0)
            {
                return(NeighbourSide.Below);
            }
            return(NeighbourSide.Above);

        case EntryPlane.YZ:
            if ((_dimensionFlipFlags & 1) == 0)
            {
                return(NeighbourSide.Left);
            }
            return(NeighbourSide.Right);

        default:
            throw new ArgumentOutOfRangeException("entryPlane", entryPlane, null);
        }
    }
示例#3
0
    private Vector3 GetNormal(EntryPlane entryPlane)
    {
        Vector3 normal;

        switch (entryPlane)
        {
        case EntryPlane.XY:
            if ((_dimensionFlipFlags & 4) == 0)
            {
                normal = Vector3.back;
            }
            else
            {
                normal = Vector3.forward;
            }

            break;

        case EntryPlane.XZ:
            if ((_dimensionFlipFlags & 2) == 0)
            {
                normal = Vector3.down;
            }
            else
            {
                normal = Vector3.up;
            }
            break;

        case EntryPlane.YZ:
            if ((_dimensionFlipFlags & 1) == 0)
            {
                normal = Vector3.left;
            }
            else
            {
                normal = Vector3.right;
            }
            break;

        default:
            throw new ArgumentOutOfRangeException("entryPlane", entryPlane, null);
        }

        return(normal);
    }
示例#4
0
    private Vector3 GetNormal(EntryPlane entryPlane)
    {
        Vector3 normal;
        switch (entryPlane) {
            case EntryPlane.XY:
                if ((_dimensionFlipFlags & 4) == 0) {
                    normal = Vector3.back;
                } else {
                    normal = Vector3.forward;
                }

                break;
            case EntryPlane.XZ:
                if ((_dimensionFlipFlags & 2) == 0) {
                    normal = Vector3.down;
                } else {
                    normal = Vector3.up;
                }
                break;
            case EntryPlane.YZ:
                if ((_dimensionFlipFlags & 1) == 0) {
                    normal = Vector3.left;
                } else {
                    normal = Vector3.right;
                }
                break;
            default:
                throw new ArgumentOutOfRangeException("entryPlane", entryPlane, null);
        }

        return normal;
    }
示例#5
0
 private NeighbourSide GetNeighbourSide(EntryPlane entryPlane)
 {
     switch (entryPlane) {
         case EntryPlane.XY:
             if ((_dimensionFlipFlags & 4) == 0) {
                 return NeighbourSide.Back;
             }
             return NeighbourSide.Forward;
         case EntryPlane.XZ:
             if ((_dimensionFlipFlags & 2) == 0) {
                 return NeighbourSide.Below;
             }
             return NeighbourSide.Above;
         case EntryPlane.YZ:
             if ((_dimensionFlipFlags & 1) == 0) {
                 return NeighbourSide.Left;
             }
             return NeighbourSide.Right;
         default:
             throw new ArgumentOutOfRangeException("entryPlane", entryPlane, null);
     }
 }