Example #1
0
    public float CreateOrbitAspect(string sigilName, Vector3 orbitPosition, Material mat)
    {
        SealComponent component = CreateComponent(sigilName + "_OrbitAspect_" + mat.name, mat);

        component.transform.localScale = Vector3.one / (1.68f * OrbitingScaleFactor);
        component.Spin(SealComponent.SpinDirection.EITHER, 0.1f, 1f);
        float orbitDegrees = component.Orbit(orbitPosition, Vector3.zero, SealComponent.SpinDirection.EITHER, 0.1f, 1f);

        return(orbitDegrees);
    }
Example #2
0
    public void Focus()
    {
        if (focused)
        {
            return;
        }

        focused = true;
        SealComponent component = CreateComponent("Focus", AspectResources.GetComponentMaterial(Aspect.Circle_Runes));

        component.Spin(SealComponent.SpinDirection.EITHER, 0.1f, 1f);
    }
Example #3
0
    public void CreateOrbitSigil(Material mat)
    {
        float   offsetDegrees = Random.Range(0, Mathf.PI * 2);
        Vector3 orbitPosition = new Vector3(Mathf.Cos(offsetDegrees), Mathf.Sin(offsetDegrees), 0) * OrbitDistance;

        float orbitDegrees = CreateOrbitAspect(mat.name, orbitPosition, AspectResources.GetComponentMaterial(Aspect.Circle));

        SealComponent component = CreateComponent("OrbitSigil_" + mat.name, mat);

        component.transform.Rotate(Vector3.up, (Mathf.Rad2Deg * offsetDegrees) - 90);
        component.transform.localScale = Vector3.one / (1.68f * OrbitingScaleFactor);

        component.Orbit(orbitPosition, Vector3.zero, orbitDegrees);
    }
Example #4
0
    public SealComponent CreateComponent(string name, Material mat)
    {
        if (sealComponents.ContainsKey(name))
        {
            sealComponents[name].DoDestroy();
        }

        GameObject obj = GameObject.CreatePrimitive(PrimitiveType.Plane);

        obj.name                       = name;
        obj.transform.parent           = this.transform;
        obj.transform.localPosition    = Vector3.zero;
        obj.transform.localEulerAngles = new Vector3(90, 0, 0);

        SealComponent component = obj.AddComponent <SealComponent>();

        component.Init(mat);

        sealComponents[name] = component;

        return(component);
    }
Example #5
0
    public void CreateCenterAspect(Material mat)
    {
        SealComponent component = CreateComponent("CenterAspect_" + mat.name, mat);

        component.Spin(SealComponent.SpinDirection.EITHER, 0.1f, 1f);
    }