Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Nori IDEHARA

31
Posts
A member registered Feb 07, 2017 · View creator page →

Creator of

Recent community posts

As shown on the webpage, it was uploaded before 3AM. Merci!

We just uploaded to itch and forgot to notify here:

https://saitot.itch.io/holy-cave-of-ruins

Conflicts!! That was close.


Finalement,  on va entrer!

Tweaking Particle System.


How to use Trigger Object

Trigger Object

Attach TriggerManger to the GameObject. If it is an object that requires "Zoom" status, check RequireZoom. If there is no prerequisites, it is done. (fig.1)

図1:単独トリガ(ズーム必須)

When the object requires other objects have already triggered, put them into prerequisites list. The object requires all the objects are triggered or destroyed. (fig.2)

図2:トリガ前提条件


Usage sample (fig.3)

    void activateObject()
   {
       Camera cam = GetComponent<Camera>();
       Ray ray = new Ray(cam.transform.position, cam.transform.forward);
       RaycastHit hit;
       if (Physics.Raycast(ray, out hit))
       {
           hit.transform.gameObject.GetComponent<TriggerManager>().pullTrigger(isZoomed);
       }
   }

図3:pullTrigger 呼び出し例(ViewController 内に実装ずみ)

Actions

To define the actions after the triggers, implement the action class from abstract class TriggerAction. (fig.4) Two protected override functions must be implemented. They are automatically called when the object is once triggered.

Caution: In this class, Update / Start are not called.

図4:トリガが引かれたときの処理(対象オブジェクトの破棄) TriggerActionDestroy.cs

図5:トリガが引かれたら継続して実行したい処理(右へ移動) TriggerActionFly.cs

Les autres membres arrivent dans quelques heures.

Le temps est compté! :)

The TriggerManager class to determine if the object is triggered:

public class TriggerManager : MonoBehaviour
{
    public bool isTriggered = false;
    public bool requireZoom;
    public TriggerManager[] prerequisites;     // Start is called before the first frame update
    void Start()
    {     }     // Update is called once per frame
    void Update()
    {
        
    }     public bool pullTrigger(bool isZoomed)
    {
        // ズームでのトリガを要求するオブジェクトが、非ズーム状態で呼ばれても無視。
        if (requireZoom && !isZoomed)
            return false;         // 前提条件オブジェクトが、トリガを引かれていない状態で存在するならば
        // トリガは引かれない。
        for (int i = 0; i < prerequisites.Length; i++)
            if (prerequisites[i] != null && !prerequisites[i].isTriggered)
                return false;         // ここまで来たら、自分のトリガを引く。
        isTriggered = true;
        return true;
    }
}
(1 edit)

Sample code to use TriggerAction abstract class:

public class TriggerActionFly : TriggerAction
{
    protected override void OnTriggered()
    {
        gameObject.GetComponent<Renderer>().material.color = Color.red;
    }
    protected override void TriggeredUpdate()
    {
        gameObject.transform.position += Vector3.right * 0.1f;
    }
}
(1 edit)

The abstract class that I made within last two hours:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
abstract public class TriggerAction : MonoBehaviour
{
    bool lastTriggerState;
    // Start is called before the first frame update
    void Start()
    {
        lastTriggerState = gameObject.GetComponent<TriggerManager>().isTriggered;
    }
    // Update is called once per frame
    void Update()
    {
        if (gameObject.GetComponent<TriggerManager>().isTriggered)
            if (lastTriggerState == false)
            {
                lastTriggerState = true;
                OnTriggered();
            }
            else
            {
                TriggeredUpdate();
            }
    }
    protected abstract void OnTriggered();
    protected abstract void TriggeredUpdate();
}

Bonsor, the active developer has switched and I could not access here until now.

Everything is fine for us, unless that we are working in turn and the photo of all the member would be very hard now. 

A bientot

And combine all the components:

... and merge!!!

Finalized the recognition part:


Smile! :)


The core code, which does not look like Unity. :)

oui!

Tokyo, 3AM

Bien sûr!

(1 edit)

and now it is 900 times faster than before. :)

Finally it works!! But VERY VERY slow for now. ;)

 

Working on the migration between C++/OpenCV and Unity.


(1 edit)

and for the logic part, we have creating a DLL using OpenCV + dlib. It is called from Unity as a DLL.


Coucou, Hiro et moi, nous ne peuvons pas travailer tout le nuit comme les jeunes. :)

Now it is my turn. ;)